mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
feat: add slashes index to navigation
- Add "/" link to desktop and mobile nav pointing to /slashes/ - Update pages collection to find content/*.md (root-level pages) - Keeps About and Now as featured nav items, with / for all pages Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,7 @@
|
||||
<a href="/">Home</a>
|
||||
<a href="/about/">About</a>
|
||||
<a href="/now/">Now</a>
|
||||
<a href="/slashes/" title="All slash pages">/</a>
|
||||
{# Blog dropdown #}
|
||||
<div class="nav-dropdown" x-data="{ open: false }" @mouseenter="open = true" @mouseleave="open = false">
|
||||
<a href="/blog/" class="nav-dropdown-trigger">
|
||||
@@ -166,6 +167,7 @@
|
||||
<a href="/">Home</a>
|
||||
<a href="/about/">About</a>
|
||||
<a href="/now/">Now</a>
|
||||
<a href="/slashes/" title="All slash pages">/</a>
|
||||
{# Blog section #}
|
||||
<div class="mobile-nav-section">
|
||||
<button type="button" class="mobile-nav-toggle" @click="blogOpen = !blogOpen">
|
||||
|
||||
@@ -340,11 +340,12 @@ export default function (eleventyConfig) {
|
||||
});
|
||||
|
||||
// Pages collection - root-level slash pages (about, now, uses, etc.)
|
||||
// These are stored in content/pages/ and output to /{slug}/
|
||||
// These are stored directly in content/ root (not in subdirectories)
|
||||
// Created via Indiekit's page post type with path: "{slug}.md"
|
||||
eleventyConfig.addCollection("pages", function (collectionApi) {
|
||||
return collectionApi
|
||||
.getFilteredByGlob("content/pages/**/*.md")
|
||||
.sort((a, b) => (a.data.title || "").localeCompare(b.data.title || ""));
|
||||
.getFilteredByGlob("content/*.md")
|
||||
.sort((a, b) => (a.data.title || a.data.name || "").localeCompare(b.data.title || b.data.name || ""));
|
||||
});
|
||||
|
||||
// All content combined for homepage feed
|
||||
|
||||
Reference in New Issue
Block a user