diff options
author | FFRaycoder <nn_201312@163.com> | 2020-05-09 10:00:46 +0300 |
---|---|---|
committer | FFRaycoder <nn_201312@163.com> | 2020-05-09 10:00:46 +0300 |
commit | ba6c1dd497c095954e38999c6e2f3d9aad202d41 (patch) | |
tree | 6c7ea417cb9a0a34d4afe6edbbe2a92ded36a84c | |
parent | bdd956dc22f2bf92e94aff53818a7eb76d5e73d1 (diff) |
tags and categories2.0
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | README.zh-cn.md | 1 | ||||
-rw-r--r-- | layouts/partials/pages/taxonomy.html | 22 | ||||
-rw-r--r-- | layouts/taxonomy/category.html | 39 | ||||
-rw-r--r-- | layouts/taxonomy/terms.html | 3 | ||||
-rw-r--r-- | theme.toml | 2 |
6 files changed, 65 insertions, 3 deletions
@@ -104,4 +104,3 @@ See <https://github.com/ThemeTony/hugo-theme-tony/tree/master/layouts/partials/c | weight | weight | weight: 2 |
| `readingBar` | enable reading bar | `readingBar: true` |
-The above classification and tab pages are not completed yet, please help:smirk:
\ No newline at end of file diff --git a/README.zh-cn.md b/README.zh-cn.md index 828eba3..8958b2c 100644 --- a/README.zh-cn.md +++ b/README.zh-cn.md @@ -101,4 +101,3 @@ $ git clone https://github.com/ThemeTony/hugo-theme-tony.git themes/tony | thumbnail | 缩略图 | thumbnail: "https://cdn.jsdelivr.net/gh/FFRaycoder/cdn/imgs/20200507094721.png" |
| weight | 文章权重 | weight: 2 |
-以上的分类与标签页尚未完成,求大佬帮助:smirk:
\ No newline at end of file diff --git a/layouts/partials/pages/taxonomy.html b/layouts/partials/pages/taxonomy.html new file mode 100644 index 0000000..0e9f749 --- /dev/null +++ b/layouts/partials/pages/taxonomy.html @@ -0,0 +1,22 @@ +<main class="main list" id="main"> + <div id="post-container" class="pjax-container"> + <div class="grid grid-centered"> + <div id="grid-cell" class="grid-cell"> + <article class="article reveal"> + <div id="load"> + <h2 class="single-h2">{{ .Title }}</h2> + <div class="article-content" style="padding-top: 10px"> + {{ $type := .Type }} + {{ range .Data.Terms.ByCount }} + {{ $name := .Name }} + {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }} + <a href="{{ .RelPermalink }}"><button class="btn btn-light">{{ .LinkTitle | default .Data.Term | default $name }}</button></a> + {{ end }} + {{ end }} + </div> + </div> + </div> + </div> + </div> + </div> +</main>
\ No newline at end of file diff --git a/layouts/taxonomy/category.html b/layouts/taxonomy/category.html new file mode 100644 index 0000000..3d2ffc5 --- /dev/null +++ b/layouts/taxonomy/category.html @@ -0,0 +1,39 @@ +<!DOCTYPE html>
+<html lang="zh">
+ {{ partial "head.html" . }}
+
+ {{ partial "header.html" . }}
+ <body>
+ <div id="index">
+ <div class="grid grid-centered" style="max-width: 660px; padding: 0px 20px; margin-top: 80px;">
+ <div id="grid-cell" class="grid-cell">
+ {{ $paginator := .Paginate (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
+
+ {{ partial "components/home/header-info.html" . }}
+ <ul class="article-list">
+ {{ range .Data.Pages }}
+ <li class="article-list-item reveal index-post-list">
+ <a href="{{.RelPermalink}}" style="text-decoration: none;">
+ <h5 style="margin: 15px 0px 0px; padding: 0px;">
+ {{ .Title }}
+ </h5>
+ </a>
+ <p>
+ {{ .Summary }}...
+ </p>
+ <div class="article-list-footer">
+ <span class="article-list-date">
+ {{ .Date.Format "02-01-06" }}
+ </span>
+ </div>
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </body>
+ {{ partial "footer.html" . }}
+
+ {{ partial "script.html" . }}
+</html>
diff --git a/layouts/taxonomy/terms.html b/layouts/taxonomy/terms.html new file mode 100644 index 0000000..a556e81 --- /dev/null +++ b/layouts/taxonomy/terms.html @@ -0,0 +1,3 @@ +{{ define "main" }} + {{ partial "pages/taxonomy.html" . }} +{{ end }}
\ No newline at end of file @@ -16,4 +16,4 @@ min_version = "0.59.1" [original] author = "TonyHe" homepage = "https://www.ouorz.com" - repo = "https://github.com/ThemeTony/tony_wordpress/"
\ No newline at end of file + repo = "https://github.com/ThemeTony/tony_wordpress/" |