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:
Ricardo
2026-02-02 12:21:06 +01:00
parent a148a90cc7
commit 5e564d3403

View File

@@ -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">