diff --git a/_docs/creating-content.md b/_docs/creating-content.md index eb1b7045..8a3d66de 100644 --- a/_docs/creating-content.md +++ b/_docs/creating-content.md @@ -108,12 +108,14 @@ If you want to use Pico as a blogging software, you probably want to do somethin
blog-index.twig
(the file name must match the Template
meta header from Step 2) in your theme directory. This template probably isn't very different from your default index.twig
(i.e. copy index.twig
), it will create a list of all your blog articles. Add the following Twig snippet to blog-index.twig
near {% raw %}{{ content }}{% endraw %}
:
-{% raw %}{% for page in pages("blog")|sort_by("time")|reverse if not page.hidden %}
- <div class="post">
- <h3><a href="{{ page.url }}">{{ page.title }}</a></h3>
- <p class="date">{{ page.date_formatted }}</p>
- <p class="excerpt">{{ page.description }}</p>
- </div>
+{% raw %}{% for page in pages("blog")|sort_by("time")|reverse %}
+ {% if not page.hidden %}
+ <div class="post">
+ <h3><a href="{{ page.url }}">{{ page.title }}</a></h3>
+ <p class="date">{{ page.date_formatted }}</p>
+ <p class="excerpt">{{ page.description }}</p>
+ </div>
+ {% endif %}
{% endfor %}
{% endraw %}