diff options
Diffstat (limited to 'templates/macros/macros.html')
| -rw-r--r-- | templates/macros/macros.html | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/templates/macros/macros.html b/templates/macros/macros.html index f343828..82e856a 100644 --- a/templates/macros/macros.html +++ b/templates/macros/macros.html @@ -1,28 +1,21 @@ -{% macro title(page) %} -<h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1> -<span>{{ page.date | date(format="%B %d, %Y") }} +{%- macro title(page) %} + <h1><a href="{{ page.permalink | safe }}">{{ page.title }}</a></h1> + <span>{{ page.date | date(format="%B %d, %Y") }} + {%- if page.taxonomies.authors and config.taxonomies %} by + {%- for author in page.taxonomies.authors %} + {%- if author_flag %} and {% endif %} + <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}">{{ author }}</a> + {%- set_global author_flag = true %} + {%- endfor %} + {%- elif config.extra.author and config.extra.author_show %} by {{ config.extra.author }} + {%- endif %} +{%- if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind="categories", name=cat) | safe }}">{{ cat }}</a>{% endfor %}]{% endif %} +{%- if page.taxonomies.tags %} {%- for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a> {% endfor -%}{%- endif %} +{%- if config.extra.readtime %} - {{ page.reading_time }} {{ config.extra.readtime_string | default(value="min") }} {% endif %} + </span> +{%- endmacro title %} -{% if page.taxonomies.authors and config.taxonomies %} by - {% for author in page.taxonomies.authors %} - {% if author_flag %} and {% endif %} - <a href="{{ get_taxonomy_url(kind='authors', name=author) | safe }}">{{ author }}</a> - {% set_global author_flag = true %} - {% endfor %} -{% elif config.extra.author and config.extra.author_show %} - by {{ config.extra.author }} -{% endif %} -{% if page.taxonomies.categories %} [{% for cat in page.taxonomies.categories %}<a href="{{ get_taxonomy_url(kind="categories", name=cat) | safe }}">{{ cat }}</a>{% endfor %}]{% endif %}</span> -{% if page.taxonomies.tags %} - <span>{% for tag in page.taxonomies.tags %} #<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a> {% endfor %}</span> -{% endif %} - -{% if config.extra.readtime | default(value=true) %} - - {{ page.reading_time }} min -{% endif %} -{% endmacro title %} - - -{% macro footer(page) %} +{%- macro footer(page) %} <h3><a href="#">Back to top</a></h3> -{% endmacro footer %} +{%- endmacro footer %} |
