Skip to content

Commit a0e9a48

Browse files
committed
refactor: Replace "ico" partial with "logo" partial
The icon usage was replaced by fontsource in #96. The remaining icon infrastructure was only used for the logos of operators. This commit simplifies the code by replacing the "ico" partial with a "logo" partial.
1 parent a164769 commit a0e9a48

File tree

7 files changed

+9
-55
lines changed

7 files changed

+9
-55
lines changed

assets/sass/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ img {
113113
.o-list__link {
114114
display: flex;
115115
align-items: center;
116+
margin-bottom: 1rem;
116117
}
117118

118119

layouts/operator/single.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<div class="o-single__header__title">
1313
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
1414
{{ $logo := resources.Get (printf "svg/logos/%s.svg" $object) }}
15+
{{ if $logo }}
1516
<img data-pagefind-meta="img" src="{{ $logo.RelPermalink }}" alt="" />
17+
{{ end }}
1618
<h1 data-pagefind-meta="title">{{ .Title }}</h1>
1719
</div>
1820
{{ partial "updateDate.html" . }}

layouts/partials/_ico.html

Lines changed: 0 additions & 50 deletions
This file was deleted.

layouts/partials/ico.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

layouts/partials/logo.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{{ $src := printf "/svg/logos/%s.svg" . }}
2+
<img src="{{$src}}" aria-hidden="true" style="height: 1.3em; width: auto" />

layouts/partials/operator-list-item.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<a href="{{ .RelPermalink }}" class="o-list__link">
22
<div class="o-list__picture o-list__picture--operator">
33
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
4-
5-
{{ partial "ico" (dict "icon" $object "theme" "logos" "size" "50") }}
4+
{{ partial "logo" $object }}
65
</div>
76
<div>
87
{{ .Title }}

layouts/partials/sidemenu.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ <h3 id="related">{{ T "_operator__list_title"}}</h3>
3030
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
3131
<li>
3232
<a id="{{ .LinkTitle }}" href="{{ .RelPermalink }}">
33+
{{ partial "logo" $object }}
3334
{{ partial "ico" (dict "icon" $object "theme" "logos" "height" "25" "width" "35") }}
3435
{{ .LinkTitle }}
3536
</a>
@@ -50,8 +51,8 @@ <h3 id="related">{{ T "_operator__nearby"}}</h3>
5051
{{ $object := replace .Path (printf "/%s/" .Page.Type) "" }}
5152
<li>
5253
<a id="{{ .LinkTitle }}" href="{{ .RelPermalink }}">
53-
{{ partial "ico" (dict "icon" $object "theme" "logos" "height" "25" "width" "35") }}
54-
{{ .LinkTitle }}
54+
{{ partial "logo" $object }}
55+
<span>{{ .LinkTitle }}</span>
5556
</a>
5657
</li>
5758
{{ end }}

0 commit comments

Comments
 (0)