generated from sofia/eleventy-base
Skip hashing in serve mode and improve responsiveness
This commit is contained in:
parent
36afcaa753
commit
ba0189de0a
3 changed files with 38 additions and 5 deletions
|
@ -42,11 +42,15 @@ async function walk(dir) {
|
|||
async function prepareManifest(assetsPath, log = console.log) {
|
||||
const files = await walk(assetsPath);
|
||||
|
||||
if (process.env.ELEVENTY_RUN_MODE === "serve") {
|
||||
log("[sofi-assets] In watch mode, skipping hashing")
|
||||
}
|
||||
|
||||
for (const absPath of files) {
|
||||
if (!(await stat(absPath)).isFile()) continue;
|
||||
|
||||
const ext = extname(absPath)
|
||||
if (!HASHED_ASSETS.includes(ext)) {
|
||||
if (!HASHED_ASSETS.includes(ext) || process.env.ELEVENTY_RUN_MODE === "serve") {
|
||||
const rel = relative(assetsPath, absPath)
|
||||
assetsManifest[rel] = rel
|
||||
continue;
|
||||
|
|
|
@ -34,8 +34,9 @@
|
|||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.site-logo {
|
||||
.site-logo, .site-logo h1 {
|
||||
font-family: "Nunito", sans-serif;
|
||||
text-decoration: none;
|
||||
color: var(--color-bg);
|
||||
}
|
||||
|
||||
|
@ -102,7 +103,33 @@
|
|||
/* Responsive */
|
||||
@media (max-width: 992px) {
|
||||
.nav-toggle {
|
||||
display: block;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: last baseline;
|
||||
padding: 0 1rem;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.site-logo {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.desktop-site-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-section-title {
|
||||
font-size: 1.3rem;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-section-list {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
font-size: 1.5rem;
|
||||
padding: 0.7rem 0.5rem;
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
<body class="site-body">
|
||||
<header class="site-header">
|
||||
<button class="nav-toggle" id="nav-toggle" aria-label="Toggle navigation" aria-expanded="false">
|
||||
☰ Menu
|
||||
<a href="/" class="site-logo"><h1>sofi web</h1></a>
|
||||
<span>☰ Menu</span>
|
||||
</button>
|
||||
|
||||
<nav class="site-nav" id="site-nav">
|
||||
<h1 class="site-logo">sofi web</h1>
|
||||
<a href="/" class="desktop-site-logo site-logo"><h1>sofi web</h1></a>
|
||||
|
||||
{% for section in site.nav %}
|
||||
<span class="nav-section-title">{{ section.title }}</span>
|
||||
|
|
Loading…
Reference in a new issue