Skip to content

Commit

Permalink
Add paige-keyword-category, tag classes
Browse files Browse the repository at this point in the history
  • Loading branch information
willfaught committed Aug 26, 2024
1 parent 4f03751 commit 9de2388
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,20 @@ Page identifiers:
<dd>The table of contents.</dd>
</dl>
Sub-page field classes:
Page classes:
<dl>
<dt><code>.paige-keyword</code></dt>
<dd>A keyword.</dd>
<dt><code>.paige-keyword-category</code></dt>
<dd>A category keyword.</dd>
<dt><code>.paige-keyword-tag</code></dt>
<dd>A tag keyword.</dd>
<dt><code>.paige-keywords</code></dt>
<dd>The keywords.</dd>
</dl>
Sub-page classes:
<dl>
<dt><code>.paige-authors</code></dt>
Expand All @@ -1102,8 +1115,6 @@ Sub-page field classes:
<dd>The date.</dd>
<dt><code>.paige-description</code></dt>
<dd>The description.</dd>
<dt><code>.paige-keywords</code></dt>
<dd>The keywords.</dd>
<dt><code>.paige-metadata</code></dt>
<dd>The metadata.</dd>
<dt><code>.paige-page</code></dt>
Expand Down
12 changes: 10 additions & 2 deletions layouts/partials/paige/list-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,22 @@
{{ with $keywords }}
<p class="paige-keywords paige-row-narrow text-center text-secondary">
{{ range $i, $term := . -}}
{{- $kind := false -}}

{{- if in $categories $term -}}
{{- $kind = "category" -}}
{{- else -}}
{{- $kind = "tag" -}}
{{- end -}}

{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}}

<a class="link-secondary paige-keyword" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- else -}}
{{- if gt $i 0 }} {{ end -}}

<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- end -}}
{{- end }}
</p>
Expand Down
12 changes: 10 additions & 2 deletions layouts/partials/paige/page-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ <h1 class="fw-bold" id="paige-page-title">{{ if $link }}<a href="{{ $link }}">{{
{{ with $keywords }}
<p class="{{ if $textkeywords }} paige-row-narrow {{ end }} text-center {{ if $textkeywords }} text-secondary {{ end }}" id="paige-keywords">
{{ range $i, $term := . -}}
{{- $kind := false -}}

{{- if in $categories $term -}}
{{- $kind = "category" -}}
{{- else -}}
{{- $kind = "tag" -}}
{{- end -}}

{{- if $textkeywords -}}
{{- if gt $i 0 }} · {{ end -}}

<a class="link-secondary paige-keyword" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="link-secondary paige-keyword paige-keyword-{{ $kind }}" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- else -}}
{{- if gt $i 0 }} {{ end -}}

<a class="badge paige-keyword text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
<a class="badge paige-keyword paige-keyword-{{ $kind }} text-bg-secondary text-decoration-none" href="{{ .RelPermalink | safeURL }}">{{ .Title }}</a>
{{- end -}}
{{- end }}
</p>
Expand Down

0 comments on commit 9de2388

Please sign in to comment.