Skip to content

Commit d5fd0b2

Browse files
committed
site: simplify base templates
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1 parent 33226cf commit d5fd0b2

14 files changed

Lines changed: 79 additions & 378 deletions

File tree

content/reference/cli/docker/scout/watch.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
---
22
datafolder: scout-cli
33
datafile: docker_scout_watch
4-
markdownfile: scout_watch.md
54
aliases:
65
- /engine/reference/commandline/scout_watch
76
title: docker scout watch
8-
layout: scout-cli
7+
layout: cli
98
---
109

1110
<!--

content/reference/samples/_index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ linkTitle: Samples
33
title: Samples overview
44
description: Learn how to containerize different types of services by walking through
55
Official Docker samples.
6-
cascade:
7-
layout: samples
8-
type: samples
96
aliases:
107
- /en/latest/examples/
118
- /engine/examples/

hugo.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ ignoreLogs:
1010

1111
taxonomies: {}
1212

13+
# Cascade layout and type settings to content subtrees.
14+
# See https://gohugo.io/configuration/cascade/#target
15+
cascade:
16+
# Guide sections use the series layout (metadata card + modules list)
17+
- target:
18+
path: /guides/**
19+
kind: section
20+
layout: series
21+
# Sample pages use the samples type (routes to layouts/samples/)
22+
- target:
23+
path: /reference/samples/**
24+
kind: page
25+
type: samples
26+
1327
# Remove the /manuals prefix for content in the manuals section
1428
permalinks:
1529
page:
Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
1-
<div class="flex w-full gap-8">
2-
<article class="prose dark:prose-invert max-w-4xl min-w-0 flex-[2_2_0%]">
3-
{{ partial "breadcrumbs.html" . }}
4-
<div class="flex items-start justify-between">
5-
<h1 data-pagefind-weight="10">{{ .Title | safeHTML }}</h1>
6-
<div class="md-dropdown ml-auto hidden lg:block">
7-
{{ partial "md-dropdown.html" . }}
8-
</div>
9-
</div>
10-
<div class="block lg:hidden">
11-
{{ partialCached "pagemeta.html" . . }}
12-
<hr />
13-
</div>
14-
{{ .Content }}
15-
{{- if and (eq .Type "guides") (not .IsSection) (ne .CurrentSection .FirstSection) -}}
16-
{{- with .PrevInSection -}}
17-
<div class="not-prose col-start-2 my-4">
18-
<a
19-
href="{{ .Permalink }}"
20-
class="cursor-pointer rounded-sm bg-blue-500 px-4 py-2 text-white hover:bg-blue-400 dark:bg-blue-800 dark:hover:bg-blue-700"
21-
>{{ .Title }} &raquo;</a
22-
>
23-
</div>
24-
{{- end -}}
25-
{{- end -}}
26-
</article>
27-
<div class="-mt-8 hidden min-w-48 flex-1 lg:block">
28-
{{ partial "aside.html" . }}
1+
{{ partial "breadcrumbs.html" . }}
2+
<div class="flex items-start justify-between">
3+
<h1 data-pagefind-weight="10">{{ .Title | safeHTML }}</h1>
4+
<div class="md-dropdown ml-auto hidden lg:block">
5+
{{ partial "md-dropdown.html" . }}
296
</div>
307
</div>
8+
<div class="block lg:hidden">
9+
{{ partialCached "pagemeta.html" . . }}
10+
<hr />
11+
</div>
12+
{{ .Content }}
13+
{{- if and (eq .Type "guides") (not .IsSection) (ne .CurrentSection .FirstSection) -}}
14+
{{- with .PrevInSection -}}
15+
<div class="not-prose col-start-2 my-4">
16+
<a
17+
href="{{ .Permalink }}"
18+
class="cursor-pointer rounded-sm bg-blue-500 px-4 py-2 text-white hover:bg-blue-400 dark:bg-blue-800 dark:hover:bg-blue-700"
19+
>{{ .Title }} &raquo;</a
20+
>
21+
</div>
22+
{{- end -}}
23+
{{- end -}}

layouts/baseof.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@
6969
>
7070
{{ partial "pagefind-meta.html" . }}
7171
{{ block "main" . }}
72+
<div class="flex w-full gap-8">
73+
<div class="min-w-0 flex-[2_2_0%]">
74+
{{ block "article" . }}
75+
<article class="prose dark:prose-invert max-w-4xl">
76+
{{ partial "content-default.html" . }}
77+
</article>
78+
{{ end }}
79+
</div>
80+
{{ block "right" . }}
81+
<div class="-mt-8 hidden min-w-48 flex-1 lg:block">
82+
{{ partial "aside.html" . }}
83+
</div>
84+
{{ end }}
85+
</div>
7286
{{ end }}
7387
</div>
7488
</main>

layouts/cli.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
{{ define "main" }}
1+
{{ define "article" }}
22
{{ $data := "" }}
33
{{ if .Params.datafolder }}
44
{{ $data = index (index site.Data .Params.datafolder) .Params.datafile }}
55
{{ else }}
66
{{ $data = index site.Data .Params.datafile }}
77
{{ end }}
8+
89
{{ .Store.Set "headings" slice }}
910
{{ .Store.Set "subheadings" slice }}
10-
<div class="flex w-full">
11-
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
11+
<article class="prose min-w-0 max-w-4xl dark:prose-invert">
1212
{{ partial "breadcrumbs.html" . }}
1313
<div class="flex items-start justify-between gap-4">
1414
<h1>{{ .Title }}</h1>
@@ -200,11 +200,11 @@ <h1>{{ .Title }}</h1>
200200
</table>
201201
{{ end }}
202202
</article>
203+
{{ end }}
203204

204-
<div class="hidden flex-1 min-w-52 lg:block">
205-
<aside
206-
class="sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full"
207-
>
205+
{{ define "right" }}
206+
<div class="hidden min-w-52 flex-1 lg:block">
207+
<aside class="sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full">
208208
<div id="TableOfContents">
209209
<div class="text-lg pb-2">{{ T "tableOfContents" }}</div>
210210
<nav class="toc">
@@ -229,5 +229,4 @@ <h1>{{ .Title }}</h1>
229229
</div>
230230
</aside>
231231
</div>
232-
233232
{{ end }}

layouts/glossary.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{{ define "main" }}
2-
{{ partial "breadcrumbs.html" . }}
1+
{{ define "article" }}
32
<article class="prose max-w-none dark:prose-invert">
3+
{{ partial "breadcrumbs.html" . }}
44
{{ with .Title }}
55
<h1 class="scroll-mt-36">{{ . }}</h1>
66
{{ end }}
77
{{ with .Content }}
8-
{{ . }}
8+
{{ . }}
99
{{ end }}
1010
<table>
1111
<thead>
@@ -28,7 +28,3 @@ <h1 class="scroll-mt-36">{{ . }}</h1>
2828
</table>
2929
</article>
3030
{{ end }}
31-
32-
{{ define "right" }}
33-
{{ partial "aside.html" . }}
34-
{{ end }}

layouts/guides/list.html

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

layouts/list.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
{{ define "main" }}
2-
{{ partial "content-default.html" . }}
1+
{{ define "article" }}
2+
<article class="prose dark:prose-invert max-w-4xl">
3+
{{ partial "content-default.html" . }}
4+
</article>
35
{{ end }}

layouts/samples/single.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{{ define "main" }}
2-
{{ partial "breadcrumbs.html" . }}
1+
{{ define "article" }}
32
<article class="prose dark:prose-invert max-w-none">
3+
{{ partial "breadcrumbs.html" . }}
44
{{ with .Title }}
55
<h1>{{ . }}</h1>
66
{{ end }}
@@ -46,7 +46,3 @@ <h2>Looking for more samples?</h2>
4646
</ul>
4747
</article>
4848
{{ end }}
49-
50-
{{ define "right" }}
51-
{{ partial "aside.html" . }}
52-
{{ end }}

0 commit comments

Comments
 (0)