Rename subpages to sections

This commit is contained in:
TheThomaas 2024-02-11 19:34:27 +01:00
parent 58d2386c61
commit 8530741337
12 changed files with 17 additions and 18 deletions

View file

@ -7,8 +7,8 @@ module.exports = config => {
config.addLayoutAlias('base', 'layouts/base.html');
config.addCollection("subpages", (collectionApi) => {
const sections = collectionApi.getFilteredByGlob("./src/pages/subpages/**")
config.addCollection("sections", (collectionApi) => {
const sections = collectionApi.getFilteredByGlob("./src/pages/sections/**")
.sort((a, b) => a.data.order - b.data.order);
process.env.DEBUG && console.log(inspect(sections));
return sections;

View file

@ -1,8 +1,8 @@
<section id="{{ subpage.data.title | slug }}" class="wrapper-full hero">
<section id="{{ section.data.title | slug }}" class="wrapper-full hero">
<div>
<h1 class="hero-title">{% if subpage.data.displayedTitle %}{{ subpage.data.displayedTitle }}{% else %}{{ subpage.data.title }}{% endif %}</h1>
<p>{{subpage.data.description}}</p>
{{ subpage.templateContent }}
<h1 class="hero-title">{% if section.data.displayedTitle %}{{ section.data.displayedTitle }}{% else %}{{ section.data.title }}{% endif %}</h1>
<p>{{section.data.description}}</p>
{{ section.templateContent }}
{% render 'partials/components/socials', socials: author.socials, mail: author.mail, showLabel: true %}
</div>
</section>

View file

@ -1,6 +1,6 @@
<section id="{{ subpage.data.title | slug }}" class="{{ subpage.data.classes }} wrapper-full">
{% if subpage.data.showTitle != false %}
<h2>{% if subpage.data.displayedTitle %}{{ subpage.data.displayedTitle }}{% else %}{{ subpage.data.title }}{% endif %}</h2>
<section id="{{ section.data.title | slug }}" class="{{ section.data.classes }} wrapper-full">
{% if section.data.showTitle != false %}
<h2>{% if section.data.displayedTitle %}{{ section.data.displayedTitle }}{% else %}{{ section.data.title }}{% endif %}</h2>
{% endif %}
{{ subpage.templateContent }}
{{ section.templateContent }}
</section>

View file

@ -1,6 +1,6 @@
<nav>
<ul>
{% for item in collections.subpages %}
{% for item in collections.sections %}
{% if item.data.excludeFromNav != true %}
<li>
<a href="#{{ item.data.title | slug }}">{{ item.data.title }}</a>

View file

@ -4,9 +4,9 @@ layout: 'base'
permalink: /
---
{% for subpage in collections.subpages %}
{% if subpage.data.excludeFromList != true %}
{% if subpage.data.template == 'hero' %}
{% for section in collections.sections %}
{% if section.data.excludeFromList != true %}
{% if section.data.template == 'hero' %}
{% include 'hero' %}
{% else %}
{% include 'page' %}

View file

@ -0,0 +1,3 @@
module.exports = {
permalink: false
};

View file

@ -1,4 +0,0 @@
module.exports = {
permalink: false,
tags: ["subpage"]
};