|
| 1 | +{% macro read_time(page) %} |
| 2 | +<svg class="i-clock" viewBox="0 0 32 32" width="16" height="16" fill="none" stroke="currentcolor" stroke-linecap="round" |
| 3 | + stroke-linejoin="round" stroke-width="6.25%"> |
| 4 | + <circle cx="16" cy="16" r="14" /> |
| 5 | + <path d="M16 8 L16 16 20 20" /> |
| 6 | +</svg> |
| 7 | +<span> {{ page.reading_time }} minute read</span> |
| 8 | +{% endmacro read_time %} |
| 9 | + |
| 10 | +{% macro article_header(page) %} |
| 11 | +<header> |
| 12 | + <div class="has-text-centered"> |
| 13 | + <a href="{{ page.permalink | safe }}"> |
| 14 | + <p class="title article-title">{{ page.title }} |
| 15 | + </p> |
| 16 | + </a> |
| 17 | + <div class="tags has-addons level-item"> |
| 18 | + {% if page.date %} |
| 19 | + <span class="tag is-rounded">{{ page.date | date(format="%F") }}</span> |
| 20 | + {% endif %} |
| 21 | + {% if page.taxonomies.authors %} |
| 22 | + <span class="tag is-rounded is-primary"> |
| 23 | + {% for author in page.taxonomies.authors %} |
| 24 | + {{ author }} |
| 25 | + {% if page.taxonomies.authors | length > 1 %} |
| 26 | + {% if loop.index != page.taxonomies.authors | length %} |
| 27 | + {% if loop.index == page.taxonomies.authors | length - 1 %} |
| 28 | + and |
| 29 | + {% else %} |
| 30 | + , |
| 31 | + {% endif %} |
| 32 | + {% endif %} |
| 33 | + {% endif %} |
| 34 | + {% endfor %} |
| 35 | + </span> |
| 36 | + {% endif %} |
| 37 | + <span class="tag is-rounded">{{ self::read_time(page=page) }}</span> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | +</header> |
| 41 | +{% endmacro article_header %} |
| 42 | + |
| 43 | +{% macro page_in_list(page) %} |
| 44 | +<article itemscope itemtype="http://schema.org/CreativeWork"> |
| 45 | + <div class="card article"> |
| 46 | + <div class="card-content"> |
| 47 | + {{ self::article_header(page = page) }} |
| 48 | + {% if page.summary %} |
| 49 | + <div itemprop="summary" class="content article-body"> |
| 50 | + {{ page.summary | safe }} |
| 51 | + <nav class="readmore"> |
| 52 | + <a itemprop="url" href="{{ page.permalink | safe }}">Read |
| 53 | + More » |
| 54 | + </a> |
| 55 | + </nav> |
| 56 | + </div> |
| 57 | + {% endif %} |
| 58 | + </div> |
| 59 | + </div> |
| 60 | +</article> |
| 61 | +{% endmacro page_in_list %} |
| 62 | + |
| 63 | +{% macro post_footer(page) %} |
| 64 | +<footer class="card-footer"> |
| 65 | + <div class="article-footer"> |
| 66 | + <div class="columns is-multiline"> |
| 67 | + <div class="column is-12"> |
| 68 | + <p> |
| 69 | + Published |
| 70 | + {{self::post_footer_date(page=page)}} |
| 71 | + {{self::post_footer_authors(page=page)}} |
| 72 | + {{self::post_footer_categories(page=page)}} |
| 73 | + {{self::post_footer_tags(page=page)}} |
| 74 | + </p> |
| 75 | + </div> |
| 76 | + <div class="column"> |
| 77 | + <a class="button is-pulled-right is-info" href="/">Back Home</a> |
| 78 | + </div> |
| 79 | + </div> |
| 80 | + </div> |
| 81 | +</footer> |
| 82 | +{% endmacro post_footer %} |
| 83 | + |
| 84 | + |
| 85 | +{% macro post_footer_date(page) %} |
| 86 | +{% if page.date %} |
| 87 | +<time datetime="{{ page.date | date(format="%F") }}"> |
| 88 | + {{ page.date | date(format="%F") }} |
| 89 | +</time> |
| 90 | +{% endif %} |
| 91 | +{% endmacro post_footer_date %} |
| 92 | + |
| 93 | + |
| 94 | +{% macro post_footer_authors(page) %} |
| 95 | +{% if page.taxonomies.authors %} |
| 96 | +by |
| 97 | +{% for author in page.taxonomies.authors %} |
| 98 | +<a href="{{ get_taxonomy_url(kind="authors", name=author) | safe }}"> |
| 99 | + <span class="tag is-primary">{{ author }} </span> |
| 100 | +</a> |
| 101 | +{% if page.taxonomies.authors | length > 1 %} |
| 102 | +{% if loop.index != page.taxonomies.authors | length %} |
| 103 | +{% if loop.index == page.taxonomies.authors | length - 1 %} |
| 104 | +and |
| 105 | +{% else %} |
| 106 | +, |
| 107 | +{% endif %} |
| 108 | +{% endif %} |
| 109 | +{% endif %} |
| 110 | +{% endfor %} |
| 111 | +{% endif %} |
| 112 | +{% endmacro post_footer_authors %} |
| 113 | + |
| 114 | + |
| 115 | +{% macro post_footer_categories(page) %} |
| 116 | +{% if page.taxonomies.categories %} |
| 117 | +{% set category = page.taxonomies.categories[0] %} |
| 118 | +in <a href="{{ get_taxonomy_url(kind="categories", name=category) | safe }}"> |
| 119 | + <span class="tag is-success"> |
| 120 | + {{ category }} |
| 121 | + </span> |
| 122 | +</a> |
| 123 | +{% endif %} |
| 124 | +{% endmacro post_footer_date %} |
| 125 | + |
| 126 | + |
| 127 | +{% macro post_footer_tags(page) %} |
| 128 | +{% if page.taxonomies.tags %} |
| 129 | +and tagged |
| 130 | +{% for tag in page.taxonomies.tags %} |
| 131 | +<a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}"> |
| 132 | + <span class="tag is-link">{{ tag }} </span> |
| 133 | +</a> |
| 134 | +{% if page.taxonomies.tags | length > 1 %} |
| 135 | +{% if loop.index != page.taxonomies.tags | length %} |
| 136 | +{% if loop.index == page.taxonomies.tags | length - 1 %} |
| 137 | +and |
| 138 | +{% else %} |
| 139 | +, |
| 140 | +{% endif %} |
| 141 | +{% endif %} |
| 142 | +{% endif %} |
| 143 | +{% endfor %} |
| 144 | +{% endif %} |
| 145 | +{% endmacro post_footer_tags %} |
0 commit comments