Rename subpages to sections
This commit is contained in:
parent
58d2386c61
commit
8530741337
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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' %}
|
||||
|
|
|
|||
3
src/pages/sections/sections.11tydata.js
Normal file
3
src/pages/sections/sections.11tydata.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = {
|
||||
permalink: false
|
||||
};
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
module.exports = {
|
||||
permalink: false,
|
||||
tags: ["subpage"]
|
||||
};
|
||||
Loading…
Reference in a new issue