Skip to content

Commit e6b166b

Browse files
committed
refactor: update icon implementation in footer, header, and languages partials
- Replace static SVG image paths with partials for icons in footer, header, and languages sections. - Update alt text for icons to use internationalization support. - Change header title from strong to h3 for better semantic structure.
1 parent d6c8789 commit e6b166b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

layouts/partials/docs/footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}}
66
{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}}
77
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}" title='{{ i18n "Last modified by" }} {{ .GitInfo.AuthorName }} | {{ $date }}' target="_blank" rel="noopener">
8-
<img src="{{ "svg/calendar.svg" | relURL }}" class="book-icon" alt="Calendar" />
8+
<img src="{{ partial "docs/icon" "calendar" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Calendar" }}" />
99
<span>{{ $date }}</span>
1010
</a>
1111
</div>
@@ -14,7 +14,7 @@
1414
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
1515
<div>
1616
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir | default "content" }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener">
17-
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="Edit" />
17+
<img src="{{ partial "docs/icon" "edit" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Edit" }}" />
1818
<span>{{ i18n "Edit this page" }}</span>
1919
</a>
2020
</div>

layouts/partials/docs/header.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div class="flex align-center justify-between">
22
<label for="menu-control">
3-
<img src="{{ "svg/menu.svg" | relURL }}" class="book-icon" alt="Menu" />
3+
<img src="{{ partial "docs/icon" "menu" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Menu" }}" />
44
</label>
55

6-
<strong>{{ partial "docs/title" . }}</strong>
6+
<h3>{{ partial "docs/title" . }}</h3>
77

88
<label for="toc-control">
9-
{{ if default true (default .Site.Params.BookToC .Params.BookToC) }}
10-
<img src="{{ "svg/toc.svg" | relURL }}" class="book-icon" alt="Table of Contents" />
9+
{{ if partial "docs/toc-show" . }}
10+
<img src="{{ partial "docs/icon" "toc" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Table of Contents" }}" />
1111
{{ end }}
1212
</label>
1313
</div>

layouts/partials/docs/languages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<input type="checkbox" id="languages" class="toggle" />
1616
<label for="languages" class="flex justify-between">
1717
<a role="button" class="flex align-center">
18-
<img src="{{ "svg/translate.svg" | relURL }}" class="book-icon" alt="Languages" />
18+
<img src="{{ partial "docs/icon" "translate" }}" class="book-icon" alt="{{ partial "docs/text/i18n" "Languages" }}" />
1919
{{ $.Site.Language.LanguageName }}
2020
</a>
2121
</label>

0 commit comments

Comments
 (0)