|
| 1 | +{#- |
| 2 | + Remember to check the changelog when updating Material for MkDocs. If the |
| 3 | + template has changed it is generally a good idea to apply the customization |
| 4 | + to the new one instead of depending on an old template, which may cause |
| 5 | + problems downstream. |
| 6 | +-#} |
| 7 | +<article class="md-post md-post--excerpt"> |
| 8 | + <header class="md-post__header"> |
| 9 | + {% if post.authors %} |
| 10 | + <nav class="md-post__authors md-typeset"> |
| 11 | + {% for author in post.authors %} |
| 12 | + <span class="md-author"> |
| 13 | + <img src="{{ author.avatar }}" alt="{{ author.name }}"> |
| 14 | + </span> |
| 15 | + {% endfor %} |
| 16 | + </nav> |
| 17 | + {% endif %} |
| 18 | + <div class="md-post__meta md-meta"> |
| 19 | + <ul class="md-meta__list"> |
| 20 | + <li class="md-meta__item"> |
| 21 | + <time datetime="{{ post.config.date.created }}"> |
| 22 | + {{- post.config.date.created | date -}} |
| 23 | + </time> |
| 24 | + <!-- start customization --> |
| 25 | + {% if post.config.date.updated %} |
| 26 | + <time datetime="{{ post.config.date.updated }}"> |
| 27 | + ({{ post.config.date.updated | date }}) |
| 28 | + </time> |
| 29 | + {% endif %} |
| 30 | + <!-- end customization --> |
| 31 | + {#- Collapse whitespace -#} |
| 32 | + </li> |
| 33 | + {% if post.categories %} |
| 34 | + <li class="md-meta__item"> |
| 35 | + {{ lang.t("blog.categories.in") }} |
| 36 | + {% for category in post.categories %} |
| 37 | + <a href="{{ category.url | url }}" class="md-meta__link"> |
| 38 | + {{- category.title -}} |
| 39 | + </a> |
| 40 | + {%- if loop.revindex > 1 %}, {% endif -%} |
| 41 | + {% endfor -%} |
| 42 | + </li> |
| 43 | + {% endif %} |
| 44 | + {% if post.config.readtime %} |
| 45 | + {% set time = post.config.readtime %} |
| 46 | + <li class="md-meta__item"> |
| 47 | + {% if time == 1 %} |
| 48 | + {{ lang.t("readtime.one") }} |
| 49 | + {% else %} |
| 50 | + {{ lang.t("readtime.other") | replace("#", time) }} |
| 51 | + {% endif %} |
| 52 | + </li> |
| 53 | + {% endif %} |
| 54 | + </ul> |
| 55 | + {% if post.config.draft %} |
| 56 | + <span class="md-draft"> |
| 57 | + {{ lang.t("blog.draft") }} |
| 58 | + </span> |
| 59 | + {% endif %} |
| 60 | + </div> |
| 61 | + </header> |
| 62 | + <div class="md-post__content md-typeset"> |
| 63 | + {{ post.content }} |
| 64 | + <nav class="md-post__action"> |
| 65 | + <a href="{{ post.url | url }}"> |
| 66 | + {{ lang.t("blog.continue") }} |
| 67 | + </a> |
| 68 | + </nav> |
| 69 | + </div> |
| 70 | +</article> |
0 commit comments