Skip to content

Commit c3bd7fb

Browse files
guides: minor layout fixes (#24679)
<!--Delete sections as needed --> ## Description At just the right medium width, some chips' text overlaps. Removed no wrap for medium. <img width="1248" height="837" alt="image" src="https://github.com/user-attachments/assets/1ac818f2-2512-4669-891d-4b1ea0735bf0" /> Some tags in the left-nav have no guides (release notes, secrets, etc.). Added conditional to make sure the tag and language has associated guides before displaying <img width="987" height="761" alt="image" src="https://github.com/user-attachments/assets/d479a1d8-e287-4320-b620-6dcfab5e04da" /> https://deploy-preview-24679--docsdocker.netlify.app/guides/?tags=distributed-systems ## Related issues or tickets ENGDOCS-3227 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Editorial review Signed-off-by: Craig Osterhout <craig.osterhout@docker.com>
1 parent f229d48 commit c3bd7fb

1 file changed

Lines changed: 32 additions & 28 deletions

File tree

layouts/guides/landing.html

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,42 @@
4141
<div class="pl-2"><strong>Tags</strong></div>
4242
<fieldset class="flex flex-col gap-2">
4343
{{- range $name, $data := site.Data.tags }}
44-
{{- $id := anchorize (fmt.Printf "tag-%s" $name) }}
45-
<div class="flex gap-2 pl-2">
46-
<input
47-
value="{{ $name }}"
48-
type="checkbox"
49-
id="{{ $id }}"
50-
@change="toggleFilter('tags', '{{ $name }}')"
51-
:checked="filters['tags'].includes('{{ $name }}')"
52-
/>
53-
<label class="select-none" for="{{ $id }}"
54-
>{{ $data.title }}</label
55-
>
56-
</div>
44+
{{- if where $.Pages "Params.tags" "intersect" (slice $name) }}
45+
{{- $id := anchorize (fmt.Printf "tag-%s" $name) }}
46+
<div class="flex gap-2 pl-2">
47+
<input
48+
value="{{ $name }}"
49+
type="checkbox"
50+
id="{{ $id }}"
51+
@change="toggleFilter('tags', '{{ $name }}')"
52+
:checked="filters['tags'].includes('{{ $name }}')"
53+
/>
54+
<label class="select-none" for="{{ $id }}"
55+
>{{ $data.title }}</label
56+
>
57+
</div>
58+
{{- end }}
5759
{{ end }}
5860
</fieldset>
5961
<div class="pl-2"><strong>Languages</strong></div>
6062
<fieldset class="flex flex-wrap gap-2 pl-2">
6163
{{- range $name, $data := site.Data.languages }}
62-
{{- $id := anchorize (fmt.Printf "lang-%s" $name) }}
63-
<button
64-
class="border-divider-light dark:border-divider-dark flex gap-1 rounded-full border bg-white px-2 py-1 dark:bg-gray-800"
65-
:class="{ 'ring-3-2 ring-3-blue-light-400 dark:ring-3-blue-dark-400': filters['languages'].includes('{{ $name }}') }"
66-
@click="toggleFilter('languages', '{{ $name }}')"
67-
>
68-
<img
69-
height="18"
70-
width="18"
71-
title="{{ $data.title }}"
72-
src="{{ $data.icon }}"
73-
/>
74-
<span>{{ $data.title }}</span>
75-
</button>
64+
{{- if where $.Pages "Params.languages" "intersect" (slice $name) }}
65+
{{- $id := anchorize (fmt.Printf "lang-%s" $name) }}
66+
<button
67+
class="border-divider-light dark:border-divider-dark flex gap-1 rounded-full border bg-white px-2 py-1 dark:bg-gray-800"
68+
:class="{ 'ring-3-2 ring-3-blue-light-400 dark:ring-3-blue-dark-400': filters['languages'].includes('{{ $name }}') }"
69+
@click="toggleFilter('languages', '{{ $name }}')"
70+
>
71+
<img
72+
height="18"
73+
width="18"
74+
title="{{ $data.title }}"
75+
src="{{ $data.icon }}"
76+
/>
77+
<span>{{ $data.title }}</span>
78+
</button>
79+
{{- end }}
7680
{{ end }}
7781
</fieldset>
7882
</div>
@@ -240,7 +244,7 @@ <h2 x-show="noFilters()" id="all-guides" class="scroll-mt-36">
240244
<div
241245
class="flex items-center justify-between gap-8 text-sm text-gray-400 dark:text-gray-300"
242246
>
243-
<div class="flex flex-wrap gap-2 md:flex-nowrap">
247+
<div class="flex flex-wrap gap-2">
244248
{{- with .Params.languages }}
245249
{{ partial "guide-languages.html" . }}
246250
{{- end }}

0 commit comments

Comments
 (0)