diff options
-rw-r--r-- | sass/_partial/_archive.scss | 4 | ||||
-rw-r--r-- | sass/_partial/_taxonomy.scss | 12 | ||||
-rw-r--r-- | sass/style.scss | 1 | ||||
-rw-r--r-- | templates/taxonomy_list.html | 32 | ||||
-rw-r--r-- | templates/taxonomy_single.html | 12 |
5 files changed, 48 insertions, 13 deletions
diff --git a/sass/_partial/_archive.scss b/sass/_partial/_archive.scss index 49ac32e..6fce40a 100644 --- a/sass/_partial/_archive.scss +++ b/sass/_partial/_archive.scss @@ -1,6 +1,6 @@ .archive { padding: 0 10%; - border: 1px #ddd; + border: 1px #616161; border-style: solid none none none; .post-archive { list-style: none; @@ -8,7 +8,7 @@ .years { border: 1px #ddd; border-style: none none solid none; - padding-bottom: 0.5em; + padding: 0.5em 0; } .post-item { .post-date { diff --git a/sass/_partial/_taxonomy.scss b/sass/_partial/_taxonomy.scss new file mode 100644 index 0000000..631fb5f --- /dev/null +++ b/sass/_partial/_taxonomy.scss @@ -0,0 +1,12 @@ +.term-name { + color: #fff; + font-size: 125%; + font-style: italic; + text-decoration: none; +} + +.term-name-heading { + border: 1px #616161; + border-style: solid none none none; + padding: 0.5em 0; +} diff --git a/sass/style.scss b/sass/style.scss index 53e334f..38aa9b7 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -28,4 +28,5 @@ body { @import "_partial/_post"; @import "_partial/_archive"; @import "_partial/_normalize"; +@import "_partial/_taxonomy"; @import "_partial/_term" diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html index 9182c43..222711c 100644 --- a/templates/taxonomy_list.html +++ b/templates/taxonomy_list.html @@ -1,12 +1,32 @@ {% extends "base.html" %} {% block content %} -<section class="posts"> - <h1 class="post-title">Tags</h1> - <section class="terms"> +<section class="archive"> {% for term in terms %} - <div class="post-content"><a href="{{ term.permalink }}" class="post-title-link">#{{ term.name }}</a></div> + <ul class="post-archive"> + {# Group the posts by year #} + {% set map = term.pages | group_by(attribute="year") %} + {% set_global years = [] %} + {# Convert the years map to an array (since maps do not have determined order) #} + {% for year, ignored in map %} + {% set_global years = years | concat(with=year) %} + {% endfor %} + + <div class="term-name"><a href="{{ term.permalink }}" class="term-name">#{{ term.name }}</a></div> + + {% for year in years | sort | reverse %} + <div class="years"> + {% set posts = map[year] %} + <div class="year">{{ year }}</div> + {% for post in posts %} + <li class="post-item"> + <span class="post-date">{{ post.date | date(format="%m/%d") }}</span> + <a href="{{ post.permalink }}" class="post-title">{{ post.title }}</a> + </li> + {% endfor %} + </div> + {% endfor %} + </ul> {% endfor %} - </section> </section> -{% endblock %} +{% endblock %}
\ No newline at end of file diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html index 9dbf19f..dec55cc 100644 --- a/templates/taxonomy_single.html +++ b/templates/taxonomy_single.html @@ -9,20 +9,22 @@ {% set pages = term.pages %} {% endif %} <section class="posts"> - <div class="post-title">{{ term.name }}</div> + <div class="post-title term-name term-name-heading"> + #{{ term.name }} + </div> {% for post in pages %} <article class="post"> <div class="post-title"><a href="{{ post.permalink }}" class="post-title-link">{{ post.title }}</a></div> <div class="post-content"> - {{ post.summary | safe }} - <a href="{{ post.permalink }}" class="More">More</a> + {{ post.summary | safe }} + <a href="{{ post.permalink }}" class="More">More</a> </div> {{ macros::post_meta(post=post, chinese_date=config.extra.seje_chinese_date, expand=false) }} </article> {% endfor %} -{# {{ paginator.next }} #} + {# {{ paginator.next }} #} </section> {% if paginator %} {% include "paginator.html" %} {% endif %} -{% endblock %} +{% endblock %}
\ No newline at end of file |