mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: disable about.njk completely with permalink: false
Set permalink: false directly in frontmatter to ensure the template never renders. Users should create their own about page via post-type-page plugin. Removed about.11tydata.js as it's no longer needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,21 +0,0 @@
|
|||||||
// Template data file for about.njk
|
|
||||||
// Dynamically sets permalink based on whether about.md exists in content/pages/
|
|
||||||
import { existsSync } from "fs";
|
|
||||||
import { resolve, dirname } from "path";
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
|
|
||||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
||||||
|
|
||||||
export default function() {
|
|
||||||
// Check for about.md in content/pages/ directory
|
|
||||||
const aboutPath = resolve(__dirname, "content/pages/about.md");
|
|
||||||
const aboutExists = existsSync(aboutPath);
|
|
||||||
|
|
||||||
return {
|
|
||||||
// If about.md exists, disable this template's permalink
|
|
||||||
// If not, use /about/ as the permalink
|
|
||||||
permalink: aboutExists ? false : "/about/",
|
|
||||||
// Also exclude from collections if about.md exists
|
|
||||||
eleventyExcludeFromCollections: aboutExists
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
layout: layouts/base.njk
|
layout: layouts/base.njk
|
||||||
title: About
|
title: About
|
||||||
|
permalink: false
|
||||||
|
eleventyExcludeFromCollections: true
|
||||||
---
|
---
|
||||||
<article class="h-card">
|
<article class="h-card">
|
||||||
<header class="mb-6 sm:mb-8 flex flex-col sm:flex-row gap-6 sm:gap-8 items-start">
|
<header class="mb-6 sm:mb-8 flex flex-col sm:flex-row gap-6 sm:gap-8 items-start">
|
||||||
|
|||||||
Reference in New Issue
Block a user