feat: added cache for css
This commit is contained in:
parent
a7676d06b6
commit
642ee3b45a
3 changed files with 93 additions and 3 deletions
|
|
@ -4,8 +4,43 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ title }} | Volpe</title>
|
||||
<link rel="stylesheet" href="/css/style.css">
|
||||
<link rel="stylesheet" href="/css/prism.css">
|
||||
|
||||
{# Critical CSS inlined for faster initial render #}
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #2c3e50;
|
||||
--secondary-color: #3498db;
|
||||
--text-color: #333;
|
||||
--background-color: #fff;
|
||||
--border-color: #ddd;
|
||||
--code-background: #f5f5f5;
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
||||
line-height: 1.6;
|
||||
color: var(--text-color);
|
||||
background-color: var(--background-color);
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
}
|
||||
header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
|
||||
header nav a { color: var(--primary-color); text-decoration: none; font-weight: bold; font-size: 1.2rem; }
|
||||
main { min-height: calc(100vh - 200px); }
|
||||
h1, h2, h3 { color: var(--primary-color); margin: 1.5rem 0 1rem; }
|
||||
h1 { font-size: 2rem; }
|
||||
footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border-color); text-align: center; color: #666; font-size: 0.9rem; }
|
||||
</style>
|
||||
|
||||
{# Preload full stylesheet with cache-busted filename #}
|
||||
<link rel="preload" href="{{ 'style.css' | cssHash }}" as="style">
|
||||
<link rel="stylesheet" href="{{ 'style.css' | cssHash }}">
|
||||
|
||||
{# Defer prism.css - only needed for syntax highlighting #}
|
||||
<link rel="preload" href="{{ 'prism.css' | cssHash }}" as="style">
|
||||
<link rel="stylesheet" href="{{ 'prism.css' | cssHash }}" media="print" onload="this.media='all'">
|
||||
<noscript><link rel="stylesheet" href="{{ 'prism.css' | cssHash }}"></noscript>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue