diff options
author | Joway.CI <joway.w@gmail.com> | 2019-12-15 18:41:31 +0300 |
---|---|---|
committer | Joway.CI <joway.w@gmail.com> | 2019-12-15 18:41:31 +0300 |
commit | ca0be59be62a35502447b720668d7b5e9171daaf (patch) | |
tree | 68277a387ea13b7b77638b5763b4b5d8adb034fa | |
parent | 9c962d294cffbe3e835c719e7317616df4ec5f2f (diff) |
add categories
-rw-r--r-- | layouts/_default/list.html | 43 | ||||
-rw-r--r-- | layouts/_default/single.html | 15 | ||||
-rw-r--r-- | layouts/index.html | 15 | ||||
-rw-r--r-- | layouts/section/list.html | 0 | ||||
-rw-r--r-- | layouts/taxonomy/list.html | 0 | ||||
-rw-r--r-- | static/css/index.css | 59 | ||||
-rw-r--r-- | static/images/tag.svg | 1 |
7 files changed, 114 insertions, 19 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..9ecaa8c --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<html lang="en"> +{{ partial "head.html" . }} + +<body> + <article class="posts"> + <div class="row"> + <div class="col-xs-12 col-sm-10 col-md-8 col-sm-offset-1 col-md-offset-2 col-lg-6 col-lg-offset-3"> + {{ partial "header.html" . }} + + <h1 class="taxonomy-term">{{.Data.Term}}</h1> + <div id="posts-list"> + {{ range (where .Data.Pages "Type" "in" site.Params.mainSections).GroupByDate "2006" -}} + <section> + <h1 class="site-date-catalog">{{ .Key }}</h1> + + {{ range .Pages }} + <div class="row posts-line"> + <div class="posts-date col-xs-2"> + <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02"}}</time> + </div> + <div class="posts-title col-xs-10"> + <div class="row"> + <div class="col-xs-12"> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + </div> + </div> + </div> + </div> + {{ end }} + </section> + {{ end }} + </div> + + {{ partial "footer.html" . }} + </div> + </div> + </article> + + {{ partial "scripts.html" . }} +</body> + +</html>
\ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 315007a..db32e7c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -34,10 +34,21 @@ <div class="post-content markdown-body"> {{ .Content }} </div> - {{ if in site.Params.mainSections .Type }} - {{ partial "related.html" . }} + <div class="row middle-xs"> + <div class="col-xs-12"> + {{ range .Params.categories }} + <div class="post-category"> + <a href="/{{ . }}/"> + {{ . }} + </a> + </div> + {{ end }} + </div> + </div> + {{ if in site.Params.mainSections .Type }} + {{ partial "related.html" . }} {{ if .Site.Params.postAds }} <div class="post-ads">{{ .Site.Params.postAds | safeHTML }}</div> {{ end }} diff --git a/layouts/index.html b/layouts/index.html index f76a692..519f63d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,12 +13,23 @@ <h1 class="site-date-catalog">{{ .Key }}</h1> {{ range .Pages }} - <div class="row post-line"> + <div class="row posts-line"> <div class="posts-date col-xs-2"> <time datetime="{{ .Date.Format "2006-01-02 15:04:05 MST" }}">{{ .Date.Format "Jan 02"}}</time> </div> <div class="posts-title col-xs-10"> - <a href="{{ .RelPermalink }}">{{ .Title }}</a> + <div class="row"> + <div class="col-xs-9 col-sm-10"> + <a href="{{ .RelPermalink }}">{{ .Title }}</a> + </div> + <div class="col-xs-3 col-sm-2 posts-categories"> + {{ range .Params.categories }} + <div class="posts-category"> + <a href="/categories/{{ lower . }}/"><strong>{{ . }}</strong></a> + </div> + {{ end }} + </div> + </div> </div> </div> {{ end }} diff --git a/layouts/section/list.html b/layouts/section/list.html deleted file mode 100644 index e69de29..0000000 --- a/layouts/section/list.html +++ /dev/null diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html deleted file mode 100644 index e69de29..0000000 --- a/layouts/taxonomy/list.html +++ /dev/null diff --git a/static/css/index.css b/static/css/index.css index 0ea93bb..1ae6e17 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -1,7 +1,11 @@ /* global */ body { - font-family: "Arvo", "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei", "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, "WenQuanYi Zen Hei Sharp", sans-serif; + font-family: "Arvo", "Helvetica Neue", Helvetica, "Nimbus Sans L", Arial, + "Liberation Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", + "Source Han Sans SC", "Source Han Sans CN", "Microsoft YaHei", + "Wenquanyi Micro Hei", "WenQuanYi Zen Hei", "ST Heiti", SimHei, + "WenQuanYi Zen Hei Sharp", sans-serif; margin: 0 20px; } @@ -62,19 +66,31 @@ a:hover { font-weight: 600; } -/* posts */ +/* posts list */ #posts-list { min-height: 70%; } -.posts-date, .posts-title { +.posts-date, +.posts-title { font-size: 1.2rem; } -.post-line { +.posts-line { margin: 12px 0; } +.posts-categories { + font-size: 0.8rem; + margin: auto; + text-align: center; +} + +.posts-category { + padding: 3px; + border: #000 2px solid; + margin-bottom: 3px; +} .site-footer { margin-top: 50px; @@ -105,7 +121,7 @@ a:hover { } } -.post img { +.post-content img { max-width: 100%; display: block; margin-left: auto; @@ -113,22 +129,29 @@ a:hover { margin-top: 12px; } -.post-date { - font-weight: 800; - font-style: italic; +.post-header { + margin-bottom: 50px; } -.post-author { - float: right; +.post-title { + font-size: 2.5rem; font-weight: 600; } -.post-header { - margin-bottom: 50px; +.post-category { + display: inline; + font-weight: 900; + padding: 2px; + border: #000 2px solid; } -.post-title { - font-size: 2.5rem; +.post-date { + font-weight: 800; + font-style: italic; +} + +.post-author { + float: right; font-weight: 600; } @@ -158,6 +181,12 @@ a:hover { margin: 5px 0; } +/* taxonomy */ + +.taxonomy-term { + font-size: 3rem; +} + /* gallery */ .gallery-img { @@ -186,4 +215,4 @@ a:hover { position: absolute; bottom: 0; background: white; -}
\ No newline at end of file +} diff --git a/static/images/tag.svg b/static/images/tag.svg new file mode 100644 index 0000000..2dc7d2f --- /dev/null +++ b/static/images/tag.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 18l2 1V3c0-1.1-.9-2-2-2H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2v13zM15 5H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2z"/></svg>
\ No newline at end of file |