hinode icon indicating copy to clipboard operation
hinode copied to clipboard

[BUG] Cannot see any tags

Open some-code-developer opened this issue 6 months ago • 1 comments

I am trying to add tags to the theme and really struggling

If i go here

https://demo.gethinode.com/en/tags/

There are no tags

But this page has tags

https://demo.gethinode.com/en/projects/sample-project/

Am I missing something?

some-code-developer avatar May 30 '25 10:05 some-code-developer

Ended up adding to files to tags folder

taxonomy.html

{{ define "body" -}}
{{- $page := . -}}
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
{{- $sections := $.Scratch.Get "sections" -}}
{{- $layout := $page.Params.layout -}}
{{- $hasSidebar := site.Params.navigation.sidebar | default true -}}
{{- $pageTitle := .Page.Title }}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

<div class="container-fluid">
    <div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 align-items-center p-3" >
        <div class="col col-md-2 d-none d-md-block"></div>
        <div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-8">

            <p class="display-4 mt-5">{{ $pageTitle }}</p>

            {{ if eq .Kind "taxonomy" }}
            <div class="row mt-5"></div>
            {{ range $.Site.Taxonomies.tags.ByCount }}
            {{- $title := .Page.Title }}
            {{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

            <div class="row mt-2">
                <div class="col-3 mt-auto text-right">
                    {{ .Count }} {{ if gt .Count 1 }} {{ T "articles" }} {{ else }} {{ T "article" }} {{ end }}
                </div>
                <div class="col-9">
                    <a href="{{ .Page.RelPermalink }}">{{ $title | .Page.RenderString }}</a>
                </div>
            </div>
            {{ end }}
            {{ if eq $.Site.Taxonomies.tags 0 }}
            <p class="pt-4">{{- T "emptyTags" }}.</p>
            {{ end }}
            {{ else }}
            {{ $dateFormat := default "Jan 2" (index .Site.Params "date_format") }}
            {{ $.Scratch.Set "lastYear" ""}}
            {{ range .Pages }}
            {{ $year := .Date.Year }}
            {{ $lastYear := $.Scratch.Get "lastYear"}}
            {{- $title := .Title }}
            {{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}
            <div class="row mt-2">
                <div class="d-none d-{{ $breakpoint.prev }}-block col-{{ $breakpoint.prev }}-3 mt-auto text-right">
                    {{ with .Date }}
                    <time class="post-date" datetime="{{ .Format " 2006-01-02T15:04:05Z07:00" | safeHTML }}">
                        {{ (partial "utilities/date.html" (dict "date" . "format" "medium")) }}
                    </time>
                    {{ else }}
                    -
                    {{ end }}
                </div>
                <div class="col">
                    {{ if ne $year $lastYear }}
                    <p class="text-body-secondary mt-5">{{ $year }}</p>
                    {{ $.Scratch.Set "lastYear" $year }}
                    {{ end }}
                    <a href="{{ .Page.RelPermalink }}">{{ if .Draft }}{{ T "draft" | upper }}: {{ end }}{{ $title | .Page.RenderString }}</a>
                </div>
            </div>
            {{ end }}
            {{ end }}
        </div>
        <div class="col col-{{ $breakpoint.current }}-2 d-none d-{{ $breakpoint.current }}-block"></div>
    </div>
</div>
{{- end -}}

and term.html

{{ define "body" -}}
{{- $page := . -}}
{{- $breakpoint := $.Scratch.Get "breakpoint" -}}
{{- $sections := $.Scratch.Get "sections" -}}
{{- $layout := $page.Params.layout -}}
{{- $hasSidebar := site.Params.navigation.sidebar | default true -}}
{{- $pageTitle := .Page.Title }}
{{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

<div class="container-fluid">
    <div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 align-items-center p-3">
        <div class="col col-md-2 d-none d-md-block"></div>
        <div class="col col-{{ $breakpoint.prev }}-12 col-{{ $breakpoint.current }}-8">

            <p class="display-4 mt-5">{{ $pageTitle }}</p>

            {{ if eq .Kind "taxonomy" }}
            <div class="row mt-5"></div>
            {{ range $.Site.Taxonomies.tags.ByCount }}
            {{- $title := .Page.Title }}
            {{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}

            <div class="row mt-2">
                <div class="col-3 mt-auto text-right">
                    {{ .Count }} {{ if gt .Count 1 }} {{ T "articles" }} {{ else }} {{ T "article" }} {{ end }}
                </div>
                <div class="col-9">
                    <a href="{{ .Page.RelPermalink }}">{{ $title | .Page.RenderString }}</a>
                </div>
            </div>
            {{ end }}
            {{ if eq $.Site.Taxonomies.tags 0 }}
            <p class="pt-4">{{- T "emptyTags" }}.</p>
            {{ end }}
            {{ else }}
            {{ $dateFormat := default "Jan 2" (index .Site.Params "date_format") }}
            {{ $.Scratch.Set "lastYear" ""}}
            {{ range .Pages }}
            {{ $year := .Date.Year }}
            {{ $lastYear := $.Scratch.Get "lastYear"}}
            {{- $title := .Title }}
            {{ if site.Params.main.titleCase }}{{ $title = title $title }}{{ end }}
            <div class="row mt-2">
                <div class="d-none d-{{ $breakpoint.prev }}-block col-{{ $breakpoint.prev }}-3 mt-auto text-right">
                    {{ with .Date }}
                    <time class="post-date" datetime="{{ .Format " 2006-01-02T15:04:05Z07:00" | safeHTML }}">
                        {{ (partial "utilities/date.html" (dict "date" . "format" "medium")) }}
                    </time>
                    {{ else }}
                    -
                    {{ end }}
                </div>
                <div class="col">
                    {{ if ne $year $lastYear }}
                    <p class="text-body-secondary mt-5">{{ $year }}</p>
                    {{ $.Scratch.Set "lastYear" $year }}
                    {{ end }}
                    <a href="{{ .Page.RelPermalink }}">{{ if .Draft }}{{ T "draft" | upper }}: {{ end }}{{ $title | .Page.RenderString }}</a>
                </div>
            </div>
            {{ end }}
            {{ end }}
        </div>
        <div class="col col-{{ $breakpoint.current }}-2 d-none d-{{ $breakpoint.current }}-block"></div>
    </div>
</div>
{{- end -}}

After that it started to work

some-code-developer avatar Jun 02 '25 17:06 some-code-developer