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.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;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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' %}
|
||||||
|
|
|
||||||
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