feat: make about.njk conditional for post-type-page compatibility
If an about page exists in the pages collection (created via post-type-page plugin), this template will not render, allowing the user-created about.md to take precedence. Falls back to this template for users without the post-type-page plugin. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
---
|
||||
layout: layouts/base.njk
|
||||
title: About
|
||||
permalink: /about/
|
||||
eleventyComputed:
|
||||
permalink: "{% set aboutPageExists = false %}{% for page in collections.pages %}{% if page.url == '/about/' %}{% set aboutPageExists = true %}{% endif %}{% endfor %}{% if aboutPageExists %}false{% else %}/about/{% endif %}"
|
||||
---
|
||||
<article class="h-card">
|
||||
<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