Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply better style for taxonomy terms #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 24 additions & 7 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{{ define "main" }}

{{ $kind := .Data.Plural }}
{{ $terms := .Data.Terms.ByCount }}


<article class="mx-6 my-8">
<h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1>
{{ with .Content }}
Expand All @@ -7,11 +12,23 @@ <h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1>
</div>
{{ end }}
</article>
<div class="bg-secondary-bg rounded px-6 py-8">
{{ range .Pages }}
<h2 class="text-lg text-primary-text my-2">
<a href="{{ .Permalink }}" class="text-eureka hover:underline">{{ .LinkTitle }}</a>
</h2>
{{ end }}

<div class="bg-secondary-bg rounded px-6 py-8 text-center">
<div class="my-4">
{{ range $index, $value := $terms }}
<a href="{{ $value.Term | urlize }}" class="inline-block bg-tertiary-bg text-sm rounded px-3 py-1 my-1 mr-2 hover:text-eureka">
{{ if eq $kind "tags" }}
<i class="fas fa-tags mr-1"></i>
{{ else if eq $kind "series" }}
<i class="fas fa-th-list mr-1"></i>
{{ else if eq $kind "categories" }}
<i class="fas fa-folder mr-1"></i>
{{ end }}
{{ $value.Term }}
<sup>{{ len $value.Pages }}</sup>
</a>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}