Use a better method of excluding drafts
This commit is contained in:
parent
326a240b8c
commit
0c0ab839d6
7 changed files with 60 additions and 20 deletions
|
|
@ -24,7 +24,7 @@
|
|||
<header>
|
||||
<nav class="navbar" aria-label="Main Menu">
|
||||
<ul class="siteNav">
|
||||
{% for section in collections.MainPage | filterDrafts | eleventyNavigation %}
|
||||
{% for section in collections.MainPage | eleventyNavigation %}
|
||||
<li {% if section.url == page.url %}class="active"{% endif %}>
|
||||
<a href="/#{{ section.title | slugify }}">
|
||||
{% if section.icon is defined %}
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% set standalonePages = collections.all | filterDrafts | IsNotMainPageSection | eleventyNavigation %}
|
||||
{% set standalonePages = collections.all | IsNotMainPageSection | eleventyNavigation %}
|
||||
|
||||
{% if standalonePages | length %}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{% if postsList | filterDrafts | IsNotPage(page.url) | length %}
|
||||
{% for post in postsList | filterDrafts | reverse %}
|
||||
{% if postsList | length %}
|
||||
{% for post in postsList | reverse %}
|
||||
<section class="posts-list-post">
|
||||
<h2><a href={{ post.url }}>{{ post.data.title }}</a></h2>
|
||||
<dl class="postMetadata">
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ metadata:
|
|||
<author>
|
||||
<name>{{ metadata.author.name }}</name>
|
||||
</author>
|
||||
{%- for post in collections.posts | filterDrafts | IsNotPage("/posts/") | reverse %}
|
||||
{%- for post in collections.posts | reverse %}
|
||||
{%- set absolutePostUrl = post.url | absoluteUrl(metadata.url) %}
|
||||
<entry>
|
||||
<title>{{ post.data.title }}</title>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ eleventyNavigation:
|
|||
tags: [ "MainPage" ]
|
||||
---
|
||||
|
||||
{% for section in collections.MainPage | filterDrafts | IsNotPage(page.url) | IsMainPageSection | orderBySectionOrder %}
|
||||
{% for section in collections.MainPage | IsNotPage(page.url) | IsMainPageSection | orderBySectionOrder %}
|
||||
{% if not loop.first %}
|
||||
<h2 id="{{ section.data.title | slugify }}">{{ section.data.title }}</h2>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ eleventyNavigation:
|
|||
order: 1
|
||||
---
|
||||
|
||||
{% set postsList = collections.posts | filterDrafts | IsNotPage(page.url) %}
|
||||
{% set postsList = collections.posts %}
|
||||
{% include "posts-list.njk" %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue