forked from termux/termux.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.html
34 lines (30 loc) · 1.45 KB
/
category.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div class="category">
{%- if page.category_name -%}
{%- assign category_posts = site.categories[page.category_name] | where: "lang", page.lang -%}
{%- assign category_translate_key = "views.index." | append: page.category_name | append: "_posts" -%}
<h1 class="page-heading">{%- include t.html root="posts" key=category_translate_key -%} ({{- category_posts.size | default: "0" -}})</h1>
{%- if category_posts.size > 0 -%}
<ul class="post-list">
{%- for post in category_posts -%}
<li>
<h3><a class="post-link" href="{{- post.url | relative_url -}}">{{- post.title | escape -}}</a></h3>
<span class="post-meta">
{{- "<strong>Created:</strong> " -}}{%- include utils/datetime/format.html date=post.date lang=post.lang strip_midnight=true -%}
{%- if post.last_modified_at -%}
{{- " <strong>Last Modified:</strong> " -}}{%- include utils/datetime/format.html date=post.last_modified_at lang=post.lang strip_midnight=true -%}
{%- endif -%}
{%- if post.author -%}
{{- " <strong>Author:</strong> " -}}{{- post.author }}
{%- endif -%}
</span>
{%- if site.show_excerpts -%}
{{ post.excerpt }}
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
{%- else -%}
<h1 class="page-heading">No Category Name Set</h1>
{%- endif -%}
</div>