Skip to content

Commit f133d25

Browse files
committed
feat: update theme
1 parent fef732f commit f133d25

File tree

9 files changed

+1441
-127
lines changed

9 files changed

+1441
-127
lines changed

layouts/_default/list.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ <h1>{{ partial "utils/title" . }}</h1>
99
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}"
1010
id="main-content" tabindex="-1"
1111
>
12+
{{ partial "page-metadata" . }}
13+
14+
{{- partial "taxonomy-meta" . -}}
15+
1216
{{ partial "utils/content" . }}
17+
18+
{{- partial "taxonomy-links" . -}}
1319
</article>
1420
{{ end }}

layouts/_default/taxonomy.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ <h1 class="gdoc-post__title">
1515
<div class="gdoc-post__readmore">
1616
{{ if .Truncated }}
1717
<a
18-
class="flex-inline align-center fake-link"
18+
class="taxonomy-link taxonomy-link-readmore flex-inline align-center"
1919
title="{{ i18n "posts_read_more" }}"
2020
href="{{ .RelPermalink }}"
2121
>
2222
{{ i18n "posts_read_more" }}
23-
<i class="gdoc-icon">gdoc_arrow_right_alt</i>
23+
<svg class="gdoc-icon" aria-hidden="true">
24+
<use xlink:href="#gdoc_arrow_right_alt"></use>
25+
</svg>
2426
</a>
2527
{{ end }}
2628
</div>

layouts/_default/terms.html

Lines changed: 101 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,106 @@
11
{{ define "main" }}
2-
<div id="main-content" tabindex="-1">
3-
{{ range .Paginator.Pages.ByTitle }}
4-
<article class="gdoc-post">
5-
<header class="gdoc-post__header">
6-
<h1 class="gdoc-post__title">
7-
<a href="{{ .RelPermalink }}">{{ partial "utils/title" . }}</a>
8-
</h1>
9-
</header>
2+
<div id="main-content" tabindex="-1" class="taxonomy-terms-page">
3+
{{- /* Page Header Section */ -}}
4+
<header class="taxonomy-terms-header">
5+
<h1 class="taxonomy-terms-title">{{ partial "utils/title" . }}</h1>
6+
{{- if .Description -}}
7+
<p class="taxonomy-terms-description">{{ .Description }}</p>
8+
{{- end -}}
9+
{{- if gt (len .Pages) 0 -}}
10+
<p class="taxonomy-terms-count" aria-live="polite">
11+
{{- $total := len .Pages -}}
12+
{{- printf "%d %s" $total (cond (eq $total 1) "term" "terms") -}}
13+
</p>
14+
{{- end -}}
15+
</header>
1016

11-
<footer class="gdoc-post__meta flex align-center">
12-
<span class="flex align-center no-wrap">
13-
{{ $pageCount := len .Pages }}
14-
<svg class="gdoc-icon gdoc_tag"><use xlink:href="#gdoc_tag"></use></svg>
15-
<span class="gdoc-post__tag">
16-
{{ i18n "posts_count" $pageCount }}
17-
</span>
18-
</span>
17+
{{- /* Main Content Grid */ -}}
18+
{{- if gt (len .Paginator.Pages) 0 -}}
19+
<div class="taxonomy-terms-grid" role="list">
20+
{{- range .Paginator.Pages.ByTitle -}}
21+
{{- $pageCount := len .Pages -}}
22+
{{- $latest := index (.Pages.ByDate.Reverse) 0 -}}
23+
<article
24+
class="taxonomy-term-card"
25+
role="listitem"
26+
aria-labelledby="term-{{ .Slug }}"
27+
>
28+
{{- /* Clickable Card Link - Entire card is clickable */ -}}
29+
<a
30+
href="{{ .RelPermalink }}"
31+
class="taxonomy-term-card__link"
32+
aria-label="View all pages for {{ partial "utils/title" . }}"
33+
>
34+
<header class="taxonomy-term-card__header">
35+
<h2 class="taxonomy-term-card__title" id="term-{{ .Slug }}">
36+
{{- partial "utils/title" . -}}
37+
</h2>
38+
</header>
1939

20-
<span class="flex align-center no-wrap">
21-
<svg class="gdoc-icon gdoc_star"><use xlink:href="#gdoc_star"></use></svg>
22-
<span>
23-
{{ $latest := index .Pages.ByDate 0 }}
24-
{{ with $latest }}
25-
<a href="{{ .RelPermalink }}">{{ partial "utils/title" . }}</a>
26-
{{ end }}
27-
</span>
28-
</span>
29-
</footer>
30-
</article>
31-
{{ end }}
40+
<div class="taxonomy-term-card__body">
41+
{{- if .Description -}}
42+
<p class="taxonomy-term-card__description">{{ .Description | truncate 120 }}</p>
43+
{{- else if $latest -}}
44+
<p class="taxonomy-term-card__description">{{ $latest.Summary | plainify | truncate 120 }}</p>
45+
{{- else -}}
46+
<p class="taxonomy-term-card__description taxonomy-term-card__description--empty">
47+
No description available
48+
</p>
49+
{{- end -}}
50+
</div>
51+
52+
<footer class="taxonomy-term-card__footer">
53+
<div class="taxonomy-term-card__meta">
54+
<span
55+
class="taxonomy-term-card__count"
56+
aria-label="{{ $pageCount }} {{ cond (eq $pageCount 1) "page" "pages" }}"
57+
>
58+
<svg class="gdoc-icon gdoc_tag" aria-hidden="true">
59+
<use xlink:href="#gdoc_tag"></use>
60+
</svg>
61+
<span class="taxonomy-term-card__count-text">
62+
{{- $pageCount -}}
63+
<span class="taxonomy-term-card__count-label">
64+
{{- cond (eq $pageCount 1) "page" "pages" -}}
65+
</span>
66+
</span>
67+
</span>
68+
69+
{{- if $latest -}}
70+
<span class="taxonomy-term-card__latest">
71+
<svg class="gdoc-icon gdoc_star" aria-hidden="true">
72+
<use xlink:href="#gdoc_star"></use>
73+
</svg>
74+
<span class="taxonomy-term-card__latest-text">
75+
Latest:
76+
<span class="taxonomy-term-card__latest-title">
77+
{{- partial "utils/title" $latest | truncate 40 -}}
78+
</span>
79+
</span>
80+
</span>
81+
{{- end -}}
82+
</div>
83+
</footer>
84+
</a>
85+
</article>
86+
{{- end -}}
87+
</div>
88+
89+
{{- /* Pagination */ -}}
90+
{{- if gt .Paginator.TotalPages 1 -}}
91+
{{- partial "pagination.html" . -}}
92+
{{- end -}}
93+
{{- else -}}
94+
{{- /* Empty State */ -}}
95+
<div class="taxonomy-terms-empty" role="status" aria-live="polite">
96+
<svg class="taxonomy-terms-empty__icon" aria-hidden="true">
97+
<use xlink:href="#gdoc_tag"></use>
98+
</svg>
99+
<h2 class="taxonomy-terms-empty__title">No terms found</h2>
100+
<p class="taxonomy-terms-empty__description">
101+
There are currently no {{ .Data.Plural }} available.
102+
</p>
103+
</div>
104+
{{- end -}}
32105
</div>
33-
{{ partial "pagination.html" . }}
34106
{{ end }}
Lines changed: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,81 @@
1-
<span class="flex align-center no-wrap">
2-
<svg class="gdoc-icon gdoc_date"><use xlink:href="#gdoc_date"></use></svg>
1+
{{- /* Date Display - Use Lastmod if available, fallback to Date */ -}}
2+
{{- $displayDate := .Lastmod -}}
3+
{{- if $displayDate.IsZero -}}
4+
{{- $displayDate = .Date -}}
5+
{{- end -}}
6+
7+
{{- /* Check if page was updated after original publish date */ -}}
8+
{{- $isUpdated := false -}}
9+
{{- if and (not .Date.IsZero) (not .Lastmod.IsZero) -}}
10+
{{- $isUpdated = .Lastmod.After (.Date.AddDate 0 0 1) -}}
11+
{{- end -}}
12+
13+
{{- /* Format datetime attribute - RFC3339/ISO8601 format for proper parsing */ -}}
14+
{{- $datetimeISO := $displayDate.Format "RFC3339" -}}
15+
16+
{{- /* Format human-readable date - use localized format if available */ -}}
17+
{{- $dateFormat := "Jan 2, 2006" -}}
18+
{{- $dateDisplay := $displayDate.Format $dateFormat -}}
19+
20+
{{- if not $displayDate.IsZero -}}
21+
<span class="flex align-center no-wrap" aria-label="{{ if $isUpdated }}{{ i18n "posts_update_prefix" }} {{ end }}{{ $dateDisplay }}">
22+
<svg class="gdoc-icon gdoc_date" aria-hidden="true">
23+
<use xlink:href="#gdoc_date"></use>
24+
</svg>
325
<span class="gdoc-post__tag">
4-
<time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">
5-
{{ if .Lastmod.After (.Date.AddDate 0 0 1) }}
6-
{{ i18n "posts_update_prefix" }}
7-
{{ end }}
8-
{{ .Lastmod.Format "Jan 2, 2006" }}
26+
<time datetime="{{ $datetimeISO }}" title="{{ $dateDisplay }}">
27+
{{- if $isUpdated -}}
28+
<span class="gdoc-post__date-prefix">{{ i18n "posts_update_prefix" }} </span>
29+
{{- end -}}
30+
<span class="gdoc-post__date-value">{{ $dateDisplay }}</span>
931
</time>
1032
</span>
1133
</span>
34+
{{- end -}}
1235

13-
<span class="flex align-center no-wrap">
14-
<svg class="gdoc-icon gdoc_timer"><use xlink:href="#gdoc_timer"></use></svg>
36+
{{- /* Reading Time */ -}}
37+
{{- if gt .ReadingTime 0 -}}
38+
<span class="flex align-center no-wrap" aria-label="{{ i18n "posts_read_time" .ReadingTime }}">
39+
<svg class="gdoc-icon gdoc_timer" aria-hidden="true">
40+
<use xlink:href="#gdoc_timer"></use>
41+
</svg>
1542
<span class="gdoc-post__tag">{{ i18n "posts_read_time" .ReadingTime }}</span>
1643
</span>
44+
{{- end -}}
1745

18-
{{ $tc := 0 }}
19-
{{ with .Params.tags }}
20-
{{ range sort . }}
21-
{{ $name := . }}
22-
{{ with $.Site.GetPage (printf "/tags/%s" $name | urlize) }}
23-
{{ if eq $tc 0 }}
46+
{{- /* Tags Display */ -}}
47+
{{- $tagCount := 0 -}}
48+
{{- with .Params.tags -}}
49+
{{- range sort . -}}
50+
{{- $tagName := . -}}
51+
{{- with $.Site.GetPage (printf "/tags/%s" ($tagName | urlize)) -}}
52+
{{- if eq $tagCount 0 -}}
2453
<span class="flex align-center no-wrap">
25-
<svg class="gdoc-icon gdoc_bookmark"><use xlink:href="#gdoc_bookmark"></use></svg>
26-
{{ template "post-tag" dict "name" $name "page" . }}
54+
<svg class="gdoc-icon gdoc_bookmark" aria-hidden="true">
55+
<use xlink:href="#gdoc_bookmark"></use>
56+
</svg>
57+
{{- template "post-tag" dict "name" $tagName "page" . -}}
2758
</span>
28-
{{ else }}
59+
{{- else -}}
2960
<span class="flex align-center">
30-
{{ template "post-tag" dict "name" $name "page" . }}
61+
{{- template "post-tag" dict "name" $tagName "page" . -}}
3162
</span>
32-
{{ end }}
33-
{{ end }}
34-
{{ $tc = (add $tc 1) }}
35-
{{ end }}
36-
{{ end }}
63+
{{- end -}}
64+
{{- end -}}
65+
{{- $tagCount = (add $tagCount 1) -}}
66+
{{- end -}}
67+
{{- end -}}
3768

38-
{{ define "post-tag" }}
39-
<span class="gdoc-post__tag gdoc-button gdoc-button--regular">
40-
<a
41-
class="gdoc-button__link"
42-
href="{{ .page.RelPermalink }}"
43-
title="{{ i18n "posts_tagged_with" .name }}"
44-
>
45-
{{ .name }}
46-
</a>
47-
</span>
48-
{{ end }}
69+
{{- /* Post Tag Template */ -}}
70+
{{- define "post-tag" -}}
71+
<span class="gdoc-post__tag gdoc-button gdoc-button--regular">
72+
<a
73+
class="gdoc-button__link"
74+
href="{{ .page.RelPermalink }}"
75+
title="{{ i18n "posts_tagged_with" .name }}"
76+
aria-label="{{ i18n "posts_tagged_with" .name }}"
77+
>
78+
{{ .name }}
79+
</a>
80+
</span>
81+
{{- end -}}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{{- /*
2+
Partial: taxonomy-links
3+
Displays navigation links to taxonomy index pages
4+
Usage: {{ partial "taxonomy-links.html" . }}
5+
*/ -}}
6+
{{- if or .Site.Taxonomies.tags .Site.Taxonomies.categories .Site.Taxonomies.features -}}
7+
<div class="taxonomy-links-container">
8+
<p>Browse Documentation by Topic:</p>
9+
<div class="taxonomy-links">
10+
{{- if .Site.Taxonomies.tags -}}
11+
<a href="{{ "tags/" | relLangURL }}" class="taxonomy-link taxonomy-link-tags">
12+
All Tags
13+
</a>
14+
{{- end -}}
15+
{{- if .Site.Taxonomies.categories -}}
16+
<a href="{{ "categories/" | relLangURL }}" class="taxonomy-link taxonomy-link-categories">
17+
All Categories
18+
</a>
19+
{{- end -}}
20+
{{- if .Site.Taxonomies.features -}}
21+
<a href="{{ "features/" | relLangURL }}" class="taxonomy-link taxonomy-link-features">
22+
All Features
23+
</a>
24+
{{- end -}}
25+
</div>
26+
</div>
27+
{{- end -}}
28+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{- $hasTaxonomy := or .Params.tags .Params.categories .Params.features -}}
2+
{{- if $hasTaxonomy -}}
3+
<div class="geekdoc-taxonomy-meta">
4+
<div>
5+
{{- if .Params.tags -}}
6+
<div class="taxonomy-group">
7+
<strong>Tags</strong>
8+
<div class="taxonomy-badges">
9+
{{- range .Params.tags -}}
10+
<a href="{{ (printf "tags/%s/" (. | urlize)) | relLangURL }}"
11+
class="taxonomy-badge taxonomy-badge-tag"
12+
aria-label="View all pages tagged with {{ . }}">
13+
{{ . }}
14+
</a>
15+
{{- end -}}
16+
</div>
17+
</div>
18+
{{- end -}}
19+
20+
{{- if .Params.categories -}}
21+
<div class="taxonomy-group">
22+
<strong>Categories</strong>
23+
<div class="taxonomy-badges">
24+
{{- range .Params.categories -}}
25+
<a href="{{ (printf "categories/%s/" (. | urlize)) | relLangURL }}"
26+
class="taxonomy-badge taxonomy-badge-category"
27+
aria-label="View all pages in category {{ . }}">
28+
{{ . }}
29+
</a>
30+
{{- end -}}
31+
</div>
32+
</div>
33+
{{- end -}}
34+
35+
{{- if .Params.features -}}
36+
<div class="taxonomy-group">
37+
<strong>Features</strong>
38+
<div class="taxonomy-badges">
39+
{{- range .Params.features -}}
40+
<a href="{{ (printf "features/%s/" (. | urlize)) | relLangURL }}"
41+
class="taxonomy-badge taxonomy-badge-feature"
42+
aria-label="View all pages for feature {{ . }}">
43+
{{ . }}
44+
</a>
45+
{{- end -}}
46+
</div>
47+
</div>
48+
{{- end -}}
49+
</div>
50+
</div>
51+
{{- end -}}
52+

layouts/posts/list.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ <h1 class="gdoc-post__title">
1313
<div class="gdoc-post__readmore">
1414
{{ if .Truncated }}
1515
<a
16-
class="flex-inline align-center fake-link"
16+
class="taxonomy-link taxonomy-link-readmore flex-inline align-center"
1717
title="{{ i18n "posts_read_more" }}"
1818
href="{{ .RelPermalink }}"
1919
>
2020
{{ i18n "posts_read_more" }}
21-
<i class="gdoc-icon">gdoc_arrow_right_alt</i>
21+
<svg class="gdoc-icon" aria-hidden="true">
22+
<use xlink:href="#gdoc_arrow_right_alt"></use>
23+
</svg>
2224
</a>
2325
{{ end }}
2426
</div>

0 commit comments

Comments
 (0)