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.addLayoutAlias('base', 'layouts/base.html');
config.addCollection("subpages", (collectionApi) => { config.addCollection("sections", (collectionApi) => {
const sections = collectionApi.getFilteredByGlob("./src/pages/subpages/**") const sections = collectionApi.getFilteredByGlob("./src/pages/sections/**")
.sort((a, b) => a.data.order - b.data.order); .sort((a, b) => a.data.order - b.data.order);
process.env.DEBUG && console.log(inspect(sections)); process.env.DEBUG && console.log(inspect(sections));
return 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> <div>
<h1 class="hero-title">{% if subpage.data.displayedTitle %}{{ subpage.data.displayedTitle }}{% else %}{{ subpage.data.title }}{% endif %}</h1> <h1 class="hero-title">{% if section.data.displayedTitle %}{{ section.data.displayedTitle }}{% else %}{{ section.data.title }}{% endif %}</h1>
<p>{{subpage.data.description}}</p> <p>{{section.data.description}}</p>
{{ subpage.templateContent }} {{ section.templateContent }}
{% render 'partials/components/socials', socials: author.socials, mail: author.mail, showLabel: true %} {% render 'partials/components/socials', socials: author.socials, mail: author.mail, showLabel: true %}
</div> </div>
</section> </section>

View file

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

View file

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

View file

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

View file

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

View file

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