diff options
author | Leonardo Faria <leonardofaria@gmail.com> | 2020-07-01 07:00:18 +0300 |
---|---|---|
committer | Leonardo Faria <leonardofaria@gmail.com> | 2020-07-01 07:00:18 +0300 |
commit | a900eb015e1a603bb3273a8237d6f7311ec19512 (patch) | |
tree | 6d6205ff0d56292434ce1ead6f60349275b2f3a8 | |
parent | 50b069b6be32b0df3c643943d2728e58da00ab64 (diff) |
Add tags / categories supporttags-in-archive
-rw-r--r-- | assets/css/site.css | 16 | ||||
-rw-r--r-- | layouts/_default/archives.html | 4 | ||||
-rw-r--r-- | layouts/taxonomy/category.html | 19 | ||||
-rw-r--r-- | layouts/taxonomy/tag.html | 19 |
4 files changed, 39 insertions, 19 deletions
diff --git a/assets/css/site.css b/assets/css/site.css index 913b753..084fe8f 100644 --- a/assets/css/site.css +++ b/assets/css/site.css @@ -344,20 +344,4 @@ html { .pagination { @apply my-5; @apply py-5; - @apply border-t; - @apply border-gray-400; -} - -.pagination { - @apply flex; - @apply justify-center; -} - -.pagination .disabled { - @apply opacity-25; -} - -.pagination a { - @apply p-2; - @apply m-2; } diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index ba0f97e..0439713 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -11,9 +11,7 @@ I like to talk about: {{range $name, $taxonomy := .Site.Taxonomies.tags}} {{ $cnt := .Count }} {{ with $.Site.GetPage (printf "/tags/%s" $name) }} - <a href={{ .RelPermalink }} title="All pages with tag {{$name}}" class="no-underline"> - {{$name}} <sup>{{$cnt}}</sup> - </a> + <a href={{ .RelPermalink }} title="All post with tag {{$name}} ({{$cnt}} posts)">{{$name}}</a> {{end}} {{end}} diff --git a/layouts/taxonomy/category.html b/layouts/taxonomy/category.html new file mode 100644 index 0000000..63642cd --- /dev/null +++ b/layouts/taxonomy/category.html @@ -0,0 +1,19 @@ +{{ define "main" }} + <div id="reading-progress-bar" role="presentation" class="fixed z-10 top-0 left-0 h-1 bg-gray-700"></div> + + <article class="article"> + <h1 class="artitle__title"><a href="{{.Permalink}}">Posts in the {{ .Title }} category</a></h1> + + {{ range .Paginator.Pages }} + <div class="border-b border-gray-400"> + <h2 class="text-3xl font-bold"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2> + + <p>{{ .Summary }}</p> + </div> + {{ end }} + </article> + + {{ if gt .Paginator.TotalPages 1 }} + {{ partial "pagination.html" . }} + {{ end }} +{{ end }} diff --git a/layouts/taxonomy/tag.html b/layouts/taxonomy/tag.html new file mode 100644 index 0000000..6241d96 --- /dev/null +++ b/layouts/taxonomy/tag.html @@ -0,0 +1,19 @@ +{{ define "main" }} + <div id="reading-progress-bar" role="presentation" class="fixed z-10 top-0 left-0 h-1 bg-gray-700"></div> + + <article class="article"> + <h1 class="artitle__title"><a href="{{.Permalink}}">Posts with the tag {{ .Title }}</a></h1> + + {{ range .Paginator.Pages }} + <div class="border-b border-gray-400"> + <h2 class="text-3xl font-bold"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2> + + <p>{{ .Summary }}</p> + </div> + {{ end }} + </article> + + {{ if gt .Paginator.TotalPages 1 }} + {{ partial "pagination.html" . }} + {{ end }} +{{ end }} |