Skip to content

Instantly share code, notes, and snippets.

@Frodox
Last active August 29, 2015 14:00
Show Gist options
  • Save Frodox/11206559 to your computer and use it in GitHub Desktop.
Save Frodox/11206559 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }}</title>
</head>
<body>
<h1><a href="{{ base_url }}">{{ site_title }}</a></h1>
{% if current_page.title == 'Welcome' %}
<!-- it's main page. need to show all articles -->
{% for page in pages %}
<h3><a href="{{ base_url }}/{{ page.url }}">{{ page.meta.title }}</a></h3>
{{ page.content|slice(1,300)|striptags }}
{% if page.meta.tags_array %}<br>
<b>Tags:</b>
{% for tag in page.meta.tags_array %}
<a href="{{ base_url }}/tag/{{ tag }}">#{{ tag }}</a>
{% endfor %}
{% endif %}
<hr>
{% endfor %}
{% else %}
<!-- it's one article. SHow only one article -->
<h2>{{ meta.title }}</h2>
{% if meta.date %}
<span class="meta-date">{{ meta.date|date(config.date_format) }}</span>
{% endif %}
{% if meta.tags_array %}<br>
<b>Tags:</b>
{% for tag in meta.tags_array %}
<a href="{{ base_url }}/tag/{{ tag }}">#{{ tag }}</a>
{% endfor %}
{% endif %}
{% spaceless %}{{ content }}{% endspaceless %}
{% endif %}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment