Released under the MIT license. Copyright (c) 2013 mcbSolutions.at
Version 0.0 alpha; Please report errors.
Better organize a blog
- Determines the index file within the content/blog folder:
{{ mcb_is_blog_start }}
- Determines if a page is a blog page (a file within the content/blog folder):
{{ mcb_is_blog_page }}
- Best use with Pico Navigation when excluding
blog
folder
- Copy/save the plugin into
plugins
folder
-
Each page of the blog has to be located in
content/blog
-
The blog file itself contains the timestamp within the meta data of the MarkDown file
/* Date: 2013-10-28 */
<nav id="nav">
<ul>
{% for page in pages if not page.date and page.title != 'Blog' %}
{% if page.title == meta.title %}
<li class="curr"><a href="{{ page.url }}">{{ page.title }}</a></li>
{% else %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</nav>
{% if mcb_is_blog_start %}
{% set num = 0 %}
{% for page in pages if num < 5 %}
{% if page.mcb_is_blog_page %}
{% set num = num + 1 %}
<h5><a href="{{ page.url }}" title="{{ page.title }}">{{ page.title }}</a></h5>
<small class="date">{{ page.date_formatted }}</small>
<p style="font-size: smaller">{{ page.excerpt }}</p>
{% endif %}
{% endfor %}
{% endif %}
{% if current_page.date and current_page.mcb_is_blog_page %}
// blog entry
{% elseif current_page.date %}
// newsentry
{% else %}
// normal page
{% endif %}
Note: Works for news and blog
{% for page in pages if page.date and page.mcb_is_blog_page == mcb_is_blog_page %}
<li><a href="{{ page.url }}">{{ page.title }}</a> <sub>{{ page.date_formatted }}</sub>
{% endfor %}