this repo has no description
at master 3.2 kB view raw
1{% macro section_meta(section, author) %} 2 <div class="post-meta"> 3 <span class="post-date"> 4 5 {%- if section.extra["date"] -%} 6 {{ section.extra["date"] | date(format="%Y.%m.%d") }} 7 {# end of section.date if-check #} 8 {%- endif -%} 9 </span> 10 11 <span class="post-author"> 12 {%- if author -%} 13 {{ utils::author(page=section) }} 14 {%- endif -%} 15 </span> 16 </div> 17{% endmacro section_meta %} 18 19{% macro langs(page) %} 20 {% if page.translations | length > 1 %} 21 <div class="post-langs" style="opacity: .5;"> 22 <span>Translations: </span>{# TODO translate the span content too #} 23 {% for translated in page.translations %} 24 <a href="{{ translated.permalink }}">{{ translated.lang }}</a> 25 {% endfor %} 26 </div> 27 {% endif %} 28{% endmacro langs %} 29 30{% macro meta(page, author) %} 31 <div class="post-meta"> 32 <span class="post-date"> 33 {%- if page.date -%} 34 {{ page.date | date(format="%Y.%m.%d") }} 35 {# end of page.date if-check #} 36 {%- endif -%} 37 38 {%- if page.updated -%} 39 [Updated: {{ page.updated | date(format="%Y.%m.%d") }}] 40 {# end of page.updated if-check #} 41 {%- endif -%} 42 </span> 43 44 <span class="post-author"> 45 {%- if author -%} 46 {{ utils::author(page=page) }} 47 {%- endif -%} 48 </span> 49 50 {{ posts::taxonomies(taxonomy=page.taxonomies, 51 disp_cat=config.extra.show_categories, 52 disp_tag=config.extra.show_tags) }} 53 </div> 54{% endmacro meta %} 55 56{% macro taxonomies(taxonomy, disp_cat, disp_tag) %} 57 58 {% if disp_cat and disp_tag -%} 59 {% if taxonomy.categories -%} 60 {{ posts::categories(categories=taxonomy.categories) }} 61 {# end if-check for categories #} 62 {%- endif -%} 63 64 {% if taxonomy.tags -%} 65 {{ posts::tags(tags=taxonomy.tags) }} 66 {# end if-check for tags #} 67 {% endif -%} 68 {% elif disp_cat -%} 69 {% if taxonomy.categories-%} 70 {{ posts::categories(categories=taxonomy.categories) }} 71 {# end if-check for categories #} 72 {% endif -%} 73 {% elif disp_tag -%} 74 {% if taxonomy.tags -%} 75 {{ posts::tags(tags=taxonomy.tags) }} 76 {# end if-check for tags #} 77 {% endif -%} 78 {# end if-check for BOTH disp bools #} 79 {% endif -%} 80{% endmacro taxonomies %} 81 82{% macro categories(categories) %} 83 :: { 84 {%- for cat in categories -%} 85 {%- if loop.last -%} 86 <a href="{{ get_taxonomy_url(kind="categories", name=cat ) }}">{{ cat }}</a> 87 {%- else -%} 88 <a href="{{ get_taxonomy_url(kind="categories", name=cat ) }}">{{ cat }}</a>, 89 {# end of if-check for whether last item or not #} 90 {%- endif -%} 91 {%- endfor -%}} {# <--- NOTE: OPEN CURLY BRACE #} 92{% endmacro categories %} 93 94{% macro tags(tags) %} 95 :: 96 {% for tag in tags -%} 97 #<a href="{{get_taxonomy_url(kind="tags", name=tag )}}">{{ tag }}</a> 98 {# end of tags for-loop #} 99 {% endfor -%} 100{% endmacro tags %}