From 95fd7d229c22207c04a309d3d52a9124d9c58048 Mon Sep 17 00:00:00 2001 From: thisLight Date: Tue, 29 Dec 2020 17:33:08 +0800 Subject: [PATCH] update theme --- themes/cmd/layout/includes/layout.swig | 1 + themes/cmd/layout/includes/paginator.swig | 11 ++++++ themes/cmd/layout/index.swig | 13 ++----- themes/cmd/layout/page.swig | 42 +++++++++++++++++++++-- themes/cmd/layout/tag.swig | 38 +++++++++++--------- themes/cmd/source/css/cmd.styl | 4 +++ 6 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 themes/cmd/layout/includes/paginator.swig diff --git a/themes/cmd/layout/includes/layout.swig b/themes/cmd/layout/includes/layout.swig index f6df304..85b2ffc 100644 --- a/themes/cmd/layout/includes/layout.swig +++ b/themes/cmd/layout/includes/layout.swig @@ -39,6 +39,7 @@ {% endfor %} {% endif %} + {% block add_head %}{% endblock %} diff --git a/themes/cmd/layout/includes/paginator.swig b/themes/cmd/layout/includes/paginator.swig new file mode 100644 index 0000000..6aedb99 --- /dev/null +++ b/themes/cmd/layout/includes/paginator.swig @@ -0,0 +1,11 @@ + +{% macro Paginiation() %} + +{% endmacro %} diff --git a/themes/cmd/layout/index.swig b/themes/cmd/layout/index.swig index 9b0d65f..d7f472f 100644 --- a/themes/cmd/layout/index.swig +++ b/themes/cmd/layout/index.swig @@ -77,16 +77,7 @@ {% endmacro %} -{% macro Paginiation() %} - -{% endmacro %} +{% import "includes/paginator.swig" as P%} {% block body %}
@@ -100,7 +91,7 @@ No Post Here... {% endif %}
- {{ Paginiation() }} + {{ P.Paginiation() }}
diff --git a/themes/cmd/layout/page.swig b/themes/cmd/layout/page.swig index 7d06a9a..ab505f4 100644 --- a/themes/cmd/layout/page.swig +++ b/themes/cmd/layout/page.swig @@ -1,9 +1,45 @@ {% extends 'includes/layout.swig' %} +{% macro PostTags(post) %} +
+{% for k in Object.keys(post.tags.data) %} +
+ {{post.tags.data[k].name}} +
+ {% endfor %} +
+{% endmacro %} + +{% macro Gallery(photos) %} +
+
+ {% set i = 0 %} + {% for p in photos %} + {% set i = i + 1 %} + + {% endfor %} +
+
+{% endmacro %} + {% block body %} -
-

{{ page.title }}

- {% autoescape false %}{{page.content }}{% endautoescape %} +
+
+
+ {{ page.title }} +
+
+
{{date(page.date, 'YYYY/M/D')}}
+
+ {{ PostTags(page) }} + {% if page.photos && page.photos.length > 0%} + {{Gallery(page.photos)}} + {% endif %} +
+ {% autoescape false %}{{ page.content }}{% endautoescape %} +
+
+
diff --git a/themes/cmd/layout/tag.swig b/themes/cmd/layout/tag.swig index d8192c7..ab1e280 100644 --- a/themes/cmd/layout/tag.swig +++ b/themes/cmd/layout/tag.swig @@ -1,21 +1,27 @@ {% extends 'includes/layout.swig' %} -{% block body %} -
-

{{ page.tag }}

- {% for article in page.posts.toArray() %} -
- - {{ article.title }} - - -
- {% endfor %} -
+{% import "includes/paginator.swig" as P %} -
- {{ paginator() }} +{% block body %} +

{{page.tag}}

+
    + {% for article in page.posts.toArray() %} +
  • +
    {{article.title}}
    +
    +
    {{ date(article.date) }}
    +
    {{article.excerpt}}
    + +
    +
  • + {% endfor %} +
+ +
+ {{ P.Paginiation() }}
{% endblock %} diff --git a/themes/cmd/source/css/cmd.styl b/themes/cmd/source/css/cmd.styl index c4b3df4..2592d9c 100644 --- a/themes/cmd/source/css/cmd.styl +++ b/themes/cmd/source/css/cmd.styl @@ -20,3 +20,7 @@ main @media only screen and (min-width: 992px) .card .card-content padding: 12px + +.collapsible .small-padding + padding: 1rem !important + padding-bottom: 0 !important \ No newline at end of file