summaryrefslogtreecommitdiffstats
path: root/templates/macros.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/macros.html')
-rw-r--r--templates/macros.html53
1 files changed, 26 insertions, 27 deletions
diff --git a/templates/macros.html b/templates/macros.html
index 14dc9e7..3d96bc3 100644
--- a/templates/macros.html
+++ b/templates/macros.html
@@ -1,12 +1,17 @@
{# misc macros #}
-{% macro nav_item(name, url) %}
- {% if page %}
- {% set curr_url = get_url(path=page.path) %}
- {% elif section %}
- {% set curr_url = get_url(path=section.path) %}
- {% endif %}
- {% set url = url | trim_end_matches(pat="/") %}
- <a {% if curr_url and curr_url == url %}class="active"{% endif %} href={{ url }}>{{ name }}</a>
+{% macro meta_item(name, href, text) %}
+ <tr>
+ <td>
+ <strong>{{ name }}</strong>
+ </td>
+ <td>
+ <a href="{{ href }}">{{ text }}</a>
+ </td>
+ </tr>
+{% endmacro nav %}
+{% macro nav_item(name, path) %}
+ {% set url = get_url(path=path,trailing_slash=true) %}
+ <a {% if url == current_url %}class="active"{% endif %} href={{ url }}>{{ name }}</a>
{% endmacro nav %}
{% macro toc_item(item, depth=0) %}
<li>
@@ -28,11 +33,11 @@
</nav>
{% endif %}
{% endmacro %}
-{% macro header(item, full=false) %}
+{% macro header(item, link=true) %}
<header>
<hgroup>
<h1>
- {% if full or not item.permalink %}
+ {% if not link or not item.permalink %}
{{ item.title }}
{% elif item.extra.external %}
<a href="{{ item.extra.external }}">{{ item.title }}</a>
@@ -61,25 +66,19 @@
</time>
{% endif %}
{% if item.authors %}
- <address class="author">
- by
- {% for author in item.authors -%}
- {% if author == config.extra.author %}
- <a rel="author" href="{{ config.base_url }}">{{ author }}</a>,
- {% elif item.extra[author] %}
- <a rel="author" href="{{ item.extra[author] }}">{{ author }}</a>,
- {% else %}
- {{ author }}
- {% endif %}
- {% endfor %}
- </address>
+ <span>
+ <address>
+ by
+ {{ item.authors | join(sep=", ") }}
+ </address>
+ </span>
+ {% endif %}
+ {% if item.updated %}
+ <time datetime="{{ item.updated | date(format="%Y-%m-%d") }}">
+ (Edited: {{ item.updated | date(format="%d %b %Y") }})
+ </time>
{% endif %}
</p>
</footer>
{% endif %}
- {% if full and item.toc %}
- {{ macros::toc(toc=item.toc) }}
- {% elif item.summary %}
- <p>{{ item.summary | safe }} ...</p>
- {% endif %}
{% endmacro %}