hugo: update layout architecture

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson 2024-09-12 17:10:05 +02:00
parent d078a3b291
commit 4443d3640a
28 changed files with 246 additions and 193 deletions

View File

@ -1,3 +1,16 @@
{ {
"plugins": ["prettier-plugin-tailwindcss"] "plugins": [
"prettier-plugin-go-template",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": [
"*.html"
],
"options": {
"parser": "go-template"
}
}
]
} }

View File

@ -1,9 +1,15 @@
/* global styles */ /* global styles */
@layer base { @layer base {
[x-cloak] { [x-cloak=""] {
display: none !important; display: none !important;
} }
/* alpine cloak for small screens only */
[x-cloak="sm"] {
@media (width <= 768px) {
display: none !important;
}
}
:root { :root {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;

View File

@ -1,4 +1,6 @@
.mantine-Modal-root { .mantine-Modal-root {
.mantine-Modal-inner { inset: 0; }
ol { ol {
list-style-type: decimal; list-style-type: decimal;
} }

View File

@ -3,7 +3,7 @@ title: Get started
keywords: Docker, get started keywords: Docker, get started
description: Get started with Docker description: Get started with Docker
notoc: true notoc: true
layout: wide
get-started: get-started:
- title: Get Docker - title: Get Docker
description: Choose the best installation path for your setup. description: Choose the best installation path for your setup.

View File

@ -3,7 +3,7 @@ title: Guides
keywords: Docker guides keywords: Docker guides
description: Explore the Docker guides description: Explore the Docker guides
notoc: true notoc: true
layout: wide
dive-deeper: dive-deeper:
- title: Language-specific guides - title: Language-specific guides
description: Learn how to containerize, develop, and test language-specific apps using Docker. description: Learn how to containerize, develop, and test language-specific apps using Docker.

View File

@ -1,7 +1,5 @@
--- ---
title: Learning paths title: Learning paths
cascade:
layout: wide
description: | description: |
Docker Learning Paths offer structured guides to help you master Docker. Docker Learning Paths offer structured guides to help you master Docker.
keywords: docker, learning, paths, tutorials, resources keywords: docker, learning, paths, tutorials, resources

View File

@ -4,6 +4,7 @@ description: Learn how to install, set up, configure, and use Docker products wi
keywords: docker, docs, manuals, products, user guides, how-to keywords: docker, docs, manuals, products, user guides, how-to
# hard-code the URL of this page # hard-code the URL of this page
url: /manuals/ url: /manuals/
layout: wide
notoc: true notoc: true
development: development:
- title: Docker Desktop - title: Docker Desktop

View File

@ -1,5 +1,6 @@
--- ---
title: Reference documentation title: Reference documentation
layout: wide
description: Find reference documentation for the Docker platforms various APIs, CLIs, and file formats description: Find reference documentation for the Docker platforms various APIs, CLIs, and file formats
notoc: true notoc: true
grid_files: grid_files:

View File

@ -1,7 +1,5 @@
--- ---
title: Tags title: Tags
cascade:
layout: wide
--- ---
Here you can browse Docker docs by tag. Here you can browse Docker docs by tag.

View File

@ -3,16 +3,20 @@
"tags": null, "tags": null,
"classes": [ "classes": [
"!mt-0", "!mt-0",
"-",
"--mount", "--mount",
"--tmpfs", "--tmpfs",
"-mb-3", "-mb-3",
"-mr-8",
"-mt-0.5", "-mt-0.5",
"-mt-1", "-mt-1",
"-mt-4", "-mt-4",
"-mt-8",
"-top-16", "-top-16",
"-v", "-v",
"-z-10", "-z-10",
".NET", ".NET",
"64px)]",
"Admin-Console", "Admin-Console",
"After", "After",
"Angular", "Angular",
@ -142,6 +146,7 @@
"bg-amber-light", "bg-amber-light",
"bg-amber-light-200", "bg-amber-light-200",
"bg-background-light", "bg-background-light",
"bg-black/50",
"bg-black/70", "bg-black/70",
"bg-blue-light", "bg-blue-light",
"bg-blue-light-400", "bg-blue-light-400",
@ -152,7 +157,6 @@
"bg-gradient-to-t", "bg-gradient-to-t",
"bg-gray-light-100", "bg-gray-light-100",
"bg-gray-light-200", "bg-gray-light-200",
"bg-gray-light-200/50",
"bg-gray-light-400", "bg-gray-light-400",
"bg-gray-light-700", "bg-gray-light-700",
"bg-green-light", "bg-green-light",
@ -188,7 +192,6 @@
"border-violet-light", "border-violet-light",
"border-white", "border-white",
"bottom-0", "bottom-0",
"box-content",
"build-push-action", "build-push-action",
"chroma", "chroma",
"col-start-2", "col-start-2",
@ -203,7 +206,6 @@
"dark:bg-gray-dark-100", "dark:bg-gray-dark-100",
"dark:bg-gray-dark-200", "dark:bg-gray-dark-200",
"dark:bg-gray-dark-300", "dark:bg-gray-dark-300",
"dark:bg-gray-dark-300/50",
"dark:bg-gray-dark-400", "dark:bg-gray-dark-400",
"dark:bg-green-dark", "dark:bg-green-dark",
"dark:bg-green-dark-400", "dark:bg-green-dark-400",
@ -222,12 +224,12 @@
"dark:border-l-magenta-dark", "dark:border-l-magenta-dark",
"dark:border-red-dark", "dark:border-red-dark",
"dark:border-violet-dark", "dark:border-violet-dark",
"dark:decoration-blue-dark",
"dark:fill-blue-dark", "dark:fill-blue-dark",
"dark:focus:ring-blue-dark", "dark:focus:ring-blue-dark",
"dark:from-background-dark", "dark:from-background-dark",
"dark:from-blue-dark-200", "dark:from-blue-dark-200",
"dark:from-blue-dark-400", "dark:from-blue-dark-400",
"dark:from-gray-dark-100",
"dark:hidden", "dark:hidden",
"dark:hover:bg-blue-dark", "dark:hover:bg-blue-dark",
"dark:hover:bg-blue-dark-500", "dark:hover:bg-blue-dark-500",
@ -241,6 +243,7 @@
"dark:text-blue-dark", "dark:text-blue-dark",
"dark:text-divider-dark", "dark:text-divider-dark",
"dark:text-gray-dark", "dark:text-gray-dark",
"dark:text-gray-dark-300",
"dark:text-gray-dark-500", "dark:text-gray-dark-500",
"dark:text-gray-dark-600", "dark:text-gray-dark-600",
"dark:text-gray-dark-700", "dark:text-gray-dark-700",
@ -250,10 +253,9 @@
"dark:text-red-dark", "dark:text-red-dark",
"dark:text-violet-dark", "dark:text-violet-dark",
"dark:text-white", "dark:text-white",
"dark:to-background-dark",
"dark:to-blue-dark-100", "dark:to-blue-dark-100",
"dark:to-magenta-dark-400", "dark:to-magenta-dark-400",
"decoration-2",
"decoration-blue-light",
"docker/bake-action", "docker/bake-action",
"docker/build-push-action", "docker/build-push-action",
"drop-shadow", "drop-shadow",
@ -263,15 +265,18 @@
"fixed", "fixed",
"flex", "flex",
"flex-1", "flex-1",
"flex-[2_2_0%]",
"flex-col", "flex-col",
"flex-col-reverse", "flex-col-reverse",
"flex-grow", "flex-grow",
"flex-none",
"flex-wrap", "flex-wrap",
"focus:ring-blue-light", "focus:ring-blue-light",
"font-medium", "font-medium",
"footnote-backref", "footnote-backref",
"footnote-ref", "footnote-ref",
"footnotes", "footnotes",
"from-20%",
"from-background-light", "from-background-light",
"from-blue-light-400", "from-blue-light-400",
"from-blue-light-600", "from-blue-light-600",
@ -296,7 +301,9 @@
"h-48", "h-48",
"h-8", "h-8",
"h-96", "h-96",
"h-[calc(100vh-64px)]",
"h-auto", "h-auto",
"h-fit",
"h-full", "h-full",
"h-max", "h-max",
"h-screen", "h-screen",
@ -313,7 +320,6 @@
"hover:dark:border-gray-dark", "hover:dark:border-gray-dark",
"hover:dark:text-blue-dark", "hover:dark:text-blue-dark",
"hover:drop-shadow-lg", "hover:drop-shadow-lg",
"hover:opacity-75",
"hover:opacity-90", "hover:opacity-90",
"hover:text-black", "hover:text-black",
"hover:text-blue-light", "hover:text-blue-light",
@ -339,9 +345,7 @@
"lg:block", "lg:block",
"lg:grid-cols-2", "lg:grid-cols-2",
"lg:grid-cols-3", "lg:grid-cols-3",
"lg:grid-cols-main-lg",
"lg:hidden", "lg:hidden",
"lg:max-w-[300px]",
"lg:no-underline", "lg:no-underline",
"lg:pb-2", "lg:pb-2",
"lg:scale-100", "lg:scale-100",
@ -354,7 +358,9 @@
"m-auto", "m-auto",
"macOS", "macOS",
"max-h-full", "max-h-full",
"max-w-4xl",
"max-w-56", "max-w-56",
"max-w-[1920px]",
"max-w-[840px]", "max-w-[840px]",
"max-w-full", "max-w-full",
"max-w-none", "max-w-none",
@ -368,14 +374,18 @@
"md:gap-8", "md:gap-8",
"md:grid-cols-2", "md:grid-cols-2",
"md:grid-cols-3", "md:grid-cols-3",
"md:grid-cols-main-md",
"md:h-[334px]", "md:h-[334px]",
"md:h-[calc(100vh",
"md:hidden", "md:hidden",
"md:max-w-[66%]", "md:max-w-[66%]",
"md:px-20", "md:px-20",
"md:scale-100", "md:scale-100",
"md:text-sm",
"md:w-[300px]",
"md:z-auto",
"min-h-screen", "min-h-screen",
"min-w-0", "min-w-0",
"min-w-52",
"ml-3", "ml-3",
"ml-auto", "ml-auto",
"mt-1", "mt-1",
@ -399,7 +409,7 @@
"overflow-clip", "overflow-clip",
"overflow-hidden", "overflow-hidden",
"overflow-x-hidden", "overflow-x-hidden",
"overflow-y-scroll", "overflow-y-auto",
"p-1", "p-1",
"p-2", "p-2",
"p-4", "p-4",
@ -410,7 +420,6 @@
"pb-0.5", "pb-0.5",
"pb-1", "pb-1",
"pb-2", "pb-2",
"pb-32",
"pb-4", "pb-4",
"pl-1", "pl-1",
"pl-2", "pl-2",
@ -419,7 +428,6 @@
"pl-5", "pl-5",
"place-items-center", "place-items-center",
"placeholder:text-white", "placeholder:text-white",
"pr-2",
"prose", "prose",
"pt-0", "pt-0",
"px-1", "px-1",
@ -439,6 +447,7 @@
"right-8", "right-8",
"ring-[1.5px]", "ring-[1.5px]",
"ring-gray-light-200", "ring-gray-light-200",
"rotate-180",
"rotate-45", "rotate-45",
"rounded", "rounded",
"rounded-[6px]", "rounded-[6px]",
@ -463,6 +472,7 @@
"sm:items-center", "sm:items-center",
"sm:w-full", "sm:w-full",
"space-x-2", "space-x-2",
"space-y-2",
"space-y-4", "space-y-4",
"sticky", "sticky",
"svg-container", "svg-container",
@ -477,6 +487,7 @@
"text-center", "text-center",
"text-divider-light", "text-divider-light",
"text-gray-light", "text-gray-light",
"text-gray-light-200",
"text-gray-light-300", "text-gray-light-300",
"text-gray-light-500", "text-gray-light-500",
"text-gray-light-600", "text-gray-light-600",
@ -491,18 +502,22 @@
"text-white", "text-white",
"text-xl", "text-xl",
"text-xs", "text-xs",
"to-30%",
"to-50%", "to-50%",
"to-75%", "to-75%",
"to-blue-light", "to-blue-light",
"to-magenta-light-400", "to-magenta-light-400",
"to-transparent", "to-transparent",
"to-white",
"toc", "toc",
"top-0", "top-0",
"top-16", "top-16",
"top-3", "top-3",
"top-6", "top-6",
"top-full", "top-full",
"transform",
"transition", "transition",
"transition-transform",
"truncate", "truncate",
"underline", "underline",
"underline-offset-2", "underline-offset-2",
@ -518,13 +533,13 @@
"w-screen", "w-screen",
"xl:grid-cols-3", "xl:grid-cols-3",
"xl:grid-cols-4", "xl:grid-cols-4",
"xl:grid-cols-main-xl",
"xl:w-[1200px]", "xl:w-[1200px]",
"xl:w-[400px]", "xl:w-[400px]",
"youtube-video", "youtube-video",
"z-10", "z-10",
"z-20", "z-20",
"z-30", "z-30",
"z-40",
"z-50" "z-50"
], ],
"ids": null "ids": null

View File

@ -1,4 +1,4 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
@ -6,48 +6,62 @@
</head> </head>
<body <body
class="bg-background-light text-base dark:bg-background-dark dark:text-white"> class="flex flex-col items-center bg-gradient-to-r from-background-light from-20% to-white to-30% text-base dark:from-gray-dark-100 dark:to-background-dark dark:text-white">
{{ partial "header.html" . }} {{ partial "header.html" . }}
<main class="grid grid-cols-1 xl:grid-cols-main-xl lg:grid-cols-main-lg md:grid-cols-main-md"> <main class="relative flex w-full max-w-[1920px]">
<!-- First column: visible on lg and xl --> <!-- Sidebar -->
<div class="hidden md:block bg-background-light dark:bg-gray-dark-100 overflow-y-scroll" <div x-data
{{- $classes := "'fixed', 'z-20', 'left-0', 'top-16', 'w-full', 'flex', 'h-lvh'" }} class="md:h-[calc(100vh - 64px)] sticky top-16 z-40 hidden h-screen flex-none overflow-y-auto overflow-x-hidden bg-background-light dark:bg-gray-dark-100 sm:w-full md:z-auto md:block md:w-[300px]"
x-data @togglesidebar.window=" :class="{ 'hidden': ! $store.showSidebar }">
if ($store.showSidebar == false) { <!-- Gray backdrop on small screens -->
document.body.classList.add('overflow-hidden'); <div class="fixed bg-black/50 md:hidden" x-show="$store.showSidebar" @click="openSidebar = false"
$el.classList.remove('hidden'); x-transition.opacity></div>
$el.classList.add({{$classes}}); <div class="z-50 w-full bg-background-light p-4 dark:bg-gray-dark-100 md:block md:w-[300px]">
$store.showSidebar = true; <!-- Collapse button for small screens -->
return; <button class="my-4 md:hidden" @click="$store.showSidebar = false">
} <span class="icon-svg">{{ partialCached "icon" "arrow_left_alt" "arrow_left_alt" }}</span>
document.body.classList.remove('overflow-hidden'); Back
$el.classList.add('hidden'); </button>
$el.classList.remove({{$classes}}); <!-- Main navigation -->
$store.showSidebar = false; <div x-data="{ expanded: false }">
" <div class="px-4 flex w-full items-center justify-between">
> <a class="text-lg flex-grow" href="{{ .FirstSection.Permalink }}">{{ .FirstSection.LinkTitle }}</a>
<div class="w-full max-w-none lg:max-w-[300px] ml-auto p-2"> <button @click="expanded = !expanded" class="rounded hover:bg-gray-light-300 hover:dark:bg-gray-dark-300">
<span :class="{ 'rotate-180': expanded }" class="icon-svg transform transition-transform">
{{ partialCached "icon" "expand_more" "expand_more" }}
</span>
</button>
</div>
<ul x-cloak x-show="expanded" class="mt-2 space-y-2 px-2">
{{ range site.Menus.main }}
{{ if ne page.FirstSection .Page }}
<li>
<a class="block px-2 py-1" href="{{ .URL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</div>
<hr class="my-2 text-gray-light-200 dark:text-gray-dark-300" />
<!-- Actual Sidebar Content -->
{{ block "left" . }} {{ block "left" . }}
{{ end }} {{ end }}
</div> </div>
</div> </div>
<div
{{- if ne .Params.sitemap false }} <!-- Main content -->
data-pagefind-body <div {{ if ne .Params.sitemap false }}data-pagefind-body{{- end }}
{{- end }} class="w-full min-w-0 bg-white p-8 dark:bg-background-dark">
class="min-w-0 px-4 pb-32">
{{ block "main" . }} {{ block "main" . }}
{{ end }} {{ end }}
</div> </div>
<div class="sticky top-16 pb-32 h-screen hidden lg:block overflow-x-hidden overflow-y-scroll pr-2">
{{ block "right" . }}
{{ end }}
</div>
</main> </main>
<footer>{{ partialCached "footer.html" . }}</footer>
<footer class="w-full">{{ partialCached "footer.html" . }}</footer>
{{/* Load the YouTube player if the page embeds a YouTube video */}} {{/* Load the YouTube player if the page embeds a YouTube video */}}
{{ with .Store.Get "youtube" }} {{ with .Store.Get "youtube" }}
{{- partial "youtube-script.html" . }} {{ partial "youtube-script.html" . }}
{{ end }} {{ end }}
</body> </body>

View File

@ -11,8 +11,9 @@
{{ end }} {{ end }}
{{ .Scratch.Set "headings" slice }} {{ .Scratch.Set "headings" slice }}
{{ .Scratch.Set "subheadings" slice }} {{ .Scratch.Set "subheadings" slice }}
<div class="flex w-full">
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
{{ partial "breadcrumbs.html" . }} {{ partial "breadcrumbs.html" . }}
<article class="prose max-w-none dark:prose-invert">
<h1 class="scroll-mt-36">{{ .Title }}</h1> <h1 class="scroll-mt-36">{{ .Title }}</h1>
<table> <table>
<tbody> <tbody>
@ -192,8 +193,34 @@ can be removed entirely in a future release.
</table> </table>
{{ end }} {{ end }}
</article> </article>
{{ end }}
{{ define "right" }} <div class="hidden flex-1 min-w-52 lg:block">
{{ partial "cli-aside.html" . }} <aside
class="sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full"
>
<div id="TableOfContents">
<div class="text-lg pb-2">{{ T "tableOfContents" }}</div>
<nav class="toc">
<ul>
{{ range (.Scratch.Get "headings") }}
{{/* add left padding depending on level (pl-2, pl-3, pl-4) */}}
{{ $slice := strings.Split .text "{#" }}
{{ $text := index $slice 0 }}
{{ $anchor := index $slice 1 | strings.TrimRight "}" }}
<li{{ with .level }} class="pl-{{ . }}"{{ end }}>
<a
{{ if $anchor }}
href="#{{ $anchor }}"
{{ else }}
href="#{{ $text | anchorize }}"
{{ end }}
>{{ markdownify $text }}</a>
</li>
{{ end }}
</ul>
</nav>
</div>
</aside>
</div>
{{ end }} {{ end }}

View File

@ -3,18 +3,5 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumbs.html" . }} {{ partial "content-default.html" . }}
<article class="prose max-w-none dark:prose-invert">
{{ with .Title }}
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ . }}</h1>
{{ end }}
<div class="block lg:hidden">
{{ partial "pagemeta.html" . }}
</div>
{{ .Content }}
</article>
{{ end }}
{{ define "right" }}
{{ partial "aside.html" . }}
{{ end }} {{ end }}

View File

@ -3,22 +3,5 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumbs.html" . }} {{ partial "content-default.html" . }}
<article class="prose max-w-none dark:prose-invert">
{{ with .Title }}
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ . }}</h1>
{{ end }}
{{ if eq .CurrentSection.Layout "series" }}
{{ partial "guides-stepper.html" . }}
{{ end }}
<div class="block lg:hidden">
{{ partialCached "pagemeta.html" . . }}
<hr>
</div>
{{ .Content }}
</article>
{{ end }}
{{ define "right" }}
{{ partial "aside.html" . }}
{{ end }} {{ end }}

View File

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ partial "head.html" . }}
</head>
<body class="flex flex-col min-h-screen bg-background-light text-base dark:bg-background-dark dark:text-white">
{{ partial "header.html" . }}
<main class="flex justify-center">
<div class="lg:w-[1200px] overflow-clip p-6 pt-0 w-lvw">
{{ block "main" . }}
{{ end }}
</div>
</main>
<footer class="mt-auto">{{ partialCached "footer.html" . }}</footer>
{{/* Load the YouTube player if the page embeds a YouTube video */}}
{{ with .Store.Get "youtube" }}
{{- partial "youtube-script.html" . }}
{{ end }}
</body>
</html>

View File

@ -0,0 +1,18 @@
{{ define "left" }}
{{ partial "sidebar.html" . }}
{{ end }}
{{ define "main" }}
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
{{ partial "breadcrumbs.html" . }}
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ .Title }}</h1>
{{ if eq .CurrentSection.Layout "series" }}
{{ partial "guides-stepper.html" . }}
{{ end }}
<div class="block lg:hidden">
{{ partialCached "pagemeta.html" . . }}
<hr />
</div>
{{ .Content }}
</article>
{{ end }}

View File

@ -1,6 +1,10 @@
{{ define "left" }}
{{- partial "sidebar.html" . }}
{{ end }}
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumbs.html" . }}
<article class="prose max-w-none dark:prose-invert"> <article class="prose max-w-none dark:prose-invert">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ .Content }} {{ .Content }}
<hr> <hr>

View File

@ -1,6 +1,6 @@
{{ define "main" }} {{ define "main" }}
{{ partial "breadcrumbs.html" . }}
<article class="prose max-w-none dark:prose-invert"> <article class="prose max-w-none dark:prose-invert">
{{ partial "breadcrumbs.html" . }}
{{- $img := resources.Get .Params.image }} {{- $img := resources.Get .Params.image }}
<img src="{{ $img.Permalink }}" alt="{{ .Title }}" class="w-full rounded-lg object-cover h-96"> <img src="{{ $img.Permalink }}" alt="{{ .Title }}" class="w-full rounded-lg object-cover h-96">
<h1 class="scroll-mt-36">{{ .Title }}</h1> <h1 class="scroll-mt-36">{{ .Title }}</h1>
@ -12,3 +12,7 @@
{{ partial "post-links.html" (where .CurrentSection.Pages "Permalink" "ne" page.Permalink) }} {{ partial "post-links.html" (where .CurrentSection.Pages "Permalink" "ne" page.Permalink) }}
</article> </article>
{{ end }} {{ end }}
{{ define "left" }}
{{- partial "sidebar.html" . }}
{{ end }}

View File

@ -1,4 +1,6 @@
<aside class="py-4 space-y-4"> <aside
class="sticky top-16 h-[calc(100vh-64px)] min-w-52 space-y-4 overflow-y-auto py-4 w-full"
>
{{ partial "github-links.html" . }} {{ partial "github-links.html" . }}
<div id="TableOfContents"> <div id="TableOfContents">
{{ partialCached "pagemeta.html" . . }} {{ partialCached "pagemeta.html" . . }}

View File

@ -1,13 +1,12 @@
<nav id="breadcrumbs" <nav id="breadcrumbs"
{{- $breadcrumbTitles := slice }} {{- $breadcrumbTitles := slice }}
data-pagefind-ignore class="gap-4 flex items-center text-gray-light dark:text-gray-dark min-w-0">
{{ range .Ancestors.Reverse }} {{ range .Ancestors.Reverse }}
{{ $breadcrumbTitles = $breadcrumbTitles | append .LinkTitle }} {{ $breadcrumbTitles = $breadcrumbTitles | append .LinkTitle }}
{{ end }}
data-pagefind-meta="breadcrumbs:{{ collections.Delimit $breadcrumbTitles " / " }}"
data-pagefind-ignore class="py-4 gap-4 flex items-center text-gray-light dark:text-gray-dark max-w-full min-w-0">
{{ range .Ancestors.Reverse }}
<a href="{{ .Permalink }}" class="link truncate">{{ markdownify .LinkTitle }}</a> <a href="{{ .Permalink }}" class="link truncate">{{ markdownify .LinkTitle }}</a>
<span>/</span> <span>/</span>
{{- end }} {{- end }}
<span class="truncate">{{ markdownify .LinkTitle }}</span> <span
data-pagefind-meta="breadcrumbs:{{ collections.Delimit $breadcrumbTitles " / " }}"
class="truncate">{{ markdownify .LinkTitle }}</span>
</nav> </nav>

View File

@ -1,24 +0,0 @@
<aside class="py-4 space-y-4">
<div id="TableOfContents">
<div class="text-lg pb-2">{{ T "tableOfContents" }}</div>
<nav class="toc">
<ul>
{{ range (.Scratch.Get "headings") }}
{{/* add left padding depending on level (pl-2, pl-3, pl-4) */}}
{{ $slice := strings.Split .text "{#" }}
{{ $text := index $slice 0 }}
{{ $anchor := index $slice 1 | strings.TrimRight "}" }}
<li{{ with .level }} class="pl-{{ . }}"{{ end }}>
<a
{{ if $anchor }}
href="#{{ $anchor }}"
{{ else }}
href="#{{ $text | anchorize }}"
{{ end }}
>{{ markdownify $text }}</a>
</li>
{{ end }}
</ul>
</nav>
</div>
</aside>

View File

@ -0,0 +1,17 @@
<div class="flex gap-8 w-full">
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
{{ partial "breadcrumbs.html" . }}
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ .Title }}</h1>
{{ if eq .CurrentSection.Layout "series" }}
{{ partial "guides-stepper.html" . }}
{{ end }}
<div class="block lg:hidden">
{{ partialCached "pagemeta.html" . . }}
<hr />
</div>
{{ .Content }}
</article>
<div class="hidden flex-1 min-w-52 lg:block -mr-8 -mt-8">
{{ partial "aside.html" . }}
</div>
</div>

View File

@ -1,4 +1,4 @@
<div class="flex justify-center py-20 px-4 bg-gray-light-200/50 dark:bg-gray-dark-300/50"> <div class="flex justify-center py-20 px-4 bg-gray-light-100 dark:bg-gray-dark-200">
<div class="flex w-full max-w-[840px] flex-col gap-10"> <div class="flex w-full max-w-[840px] flex-col gap-10">
<div class="flex flex-col md:flex-row gap-4 items-center justify-evenly"> <div class="flex flex-col md:flex-row gap-4 items-center justify-evenly">
<a class="underline-offset-2 hover:underline" href="https://www.docker.com/">Product offerings</a> <a class="underline-offset-2 hover:underline" href="https://www.docker.com/">Product offerings</a>

View File

@ -1,13 +1,12 @@
<header <header class="w-full sticky top-0 z-20 h-16 px-6 text-white bg-gradient-to-r from-blue-light-600 to-blue-light dark:from-blue-dark-200 to-50% dark:to-blue-dark-100">
class="sticky top-0 z-20 h-16 px-6 text-white bg-gradient-to-r from-blue-light-600 to-blue-light dark:from-blue-dark-200 to-50% dark:to-blue-dark-100"> <div class="max-w-[1920px] mx-auto flex gap-8 h-full items-center justify-between">
<div class="mx-auto flex h-full items-center justify-between">
<div class="flex h-full items-center md:gap-8 gap-2"> <div class="flex h-full items-center md:gap-8 gap-2">
{{ if not .IsHome }} {{- if not .IsHome }}
<button x-data @click="$dispatch('togglesidebar')" <button x-data @click="$store.showSidebar = true"
class="icon-svg block px-4 md:hidden h-full" aria-label="Menu"> class="icon-svg block px-4 md:hidden h-full" aria-label="Menu">
{{ partialCached "icon" "menu" "menu" }} {{ partialCached "icon" "menu" "menu" }}
</button> </button>
{{ end }} {{- end }}
<div> <div>
{{/* main logo */}} {{/* main logo */}}
<a title="Docker Docs home page" href="{{ site.BaseURL }}"> <a title="Docker Docs home page" href="{{ site.BaseURL }}">
@ -16,8 +15,8 @@
</div> </div>
</a> </a>
</div> </div>
<nav> <nav class="mt-1 hidden md:block">
<ul class="mt-1 box-content hidden gap-4 md:flex"> <ul class="flex gap-4">
{{ range site.Menus.main }} {{ range site.Menus.main }}
<li <li
{{- if or (eq page .Page) (page.IsDescendant .Page) }} {{- if or (eq page .Page) (page.IsDescendant .Page) }}
@ -31,7 +30,7 @@
</ul> </ul>
</nav> </nav>
</div> </div>
<div class="flex items-center gap-6 flex-grow justify-end"> <div class="flex min-w-0 items-center gap-6 flex-grow justify-end">
{{ partialCached "search-bar.html" "-" }} {{ partialCached "search-bar.html" "-" }}
<button aria-label="Theme switch" id="theme-switch" class="svg-icon" <button aria-label="Theme switch" id="theme-switch" class="svg-icon"
x-data="{ theme: localStorage.getItem('theme-preference') }" x-init="$watch('theme', value => { x-data="{ theme: localStorage.getItem('theme-preference') }" x-init="$watch('theme', value => {

View File

@ -1,20 +1,9 @@
{{/* Render the top-nav in sidebar for small screens */}} <!-- section tree -->
<nav class="text-sm pb-4 gap-4 flex md:hidden flex-col justify-evenly"> <nav class="md:text-sm flex flex-col">
<div class="text-gray-light dark:text-gray-dark">Main sections</div> <div
{{ range site.Menus.main }} class="block py-4 md:hidden text-gray-light dark:text-gray-dark">This section</div>
<div class="pl-2 underline-offset-8 decoration-2 hover:underline decoration-blue-light dark:decoration-blue-dark hover:opacity-75
{{- if or (page.IsDescendant .Page) (eq page .Page) }}
underline
{{- end }}">
<a href="{{ .URL }}">{{ .Name }}</a>
</div>
{{ end }}
</nav>
<nav class="text-sm flex flex-col">
<div class="block py-4 md:hidden text-gray-light dark:text-gray-dark">This section</div>
{{/* The current page is in the table of contents */}} {{/* The current page is in the table of contents */}}
<ul> <ul>
{{ template "renderSingle" .FirstSection }}
{{ template "renderChildren" .FirstSection }} {{ template "renderChildren" .FirstSection }}
</ul> </ul>
</nav> </nav>
@ -42,21 +31,21 @@
{{ $expanded := or $isCurrent (page.IsDescendant .) }} {{ $expanded := or $isCurrent (page.IsDescendant .) }}
<li x-data="{ expanded: {{$expanded}} }"> <li x-data="{ expanded: {{$expanded}} }">
<div class="rounded px-4 w-full flex items-center justify-between{{ if $isCurrent }} bg-gray-light-200 dark:bg-gray-dark-200{{ end }}"> <div class="rounded px-4 w-full flex items-center justify-between{{ if $isCurrent }} bg-gray-light-200 dark:bg-gray-dark-200{{ end }}">
<span class="py-2 truncate flex items-center gap-2"> <div class="w-full py-2 truncate">
{{- if .Permalink }} {{- if .Permalink }}
{{/* If the link is not empty, use it */}} {{/* If the link is not empty, use it */}}
<a class="select-none hover:text-blue-light hover:dark:text-blue-dark" <a class="block select-none hover:text-blue-light hover:dark:text-blue-dark"
href="{{ .Permalink }}"> href="{{ .Permalink }}">
{{ template "renderTitle" . }} {{ template "renderTitle" . }}
</a> </a>
{{- else }} {{- else }}
{{/* Otherwise, just expand the section */}} {{/* Otherwise, just expand the section */}}
<button @click="expanded = !expanded" <button @click="expanded = !expanded"
class="select-none hover:text-blue-light hover:dark:text-blue-dark"> class="w-full text-left select-none hover:text-blue-light hover:dark:text-blue-dark">
{{ template "renderTitle" . }} {{ template "renderTitle" . }}
</button> </button>
{{- end }} {{- end }}
</span> </div>
<button @click="expanded = !expanded" class="hover:bg-gray-light-300 hover:dark:bg-gray-dark-300 rounded"> <button @click="expanded = !expanded" class="hover:bg-gray-light-300 hover:dark:bg-gray-dark-300 rounded">
<span :class="{ 'hidden' : expanded }" class="icon-svg {{ if $expanded }}hidden{{ end }}"> <span :class="{ 'hidden' : expanded }" class="icon-svg {{ if $expanded }}hidden{{ end }}">
{{ partialCached "icon" "expand_more" "expand_more" }} {{ partialCached "icon" "expand_more" "expand_more" }}
@ -76,11 +65,9 @@
{{- if .Params.goto }} {{- if .Params.goto }}
<li class="pl-4 hover:text-blue-light hover:dark:text-blue-dark"> <li class="pl-4 hover:text-blue-light hover:dark:text-blue-dark">
<a class="py-2 w-full truncate block" <a class="py-2 w-full truncate block"
href="{{ markdownify .Params.goto }}" href="{{ .Params.goto }}"
title="{{ markdownify .Title }}"> title="{{ .LinkTitle }}">
<span class="flex items-center gap-2">
{{ template "renderTitle" . }} {{ template "renderTitle" . }}
</span>
</a> </a>
</li> </li>
{{- else }} {{- else }}
@ -88,10 +75,8 @@
<li class="pl-4 hover:text-blue-light hover:dark:text-blue-dark <li class="pl-4 hover:text-blue-light hover:dark:text-blue-dark
{{ if $isCurrent }} bg-gray-light-200 dark:bg-gray-dark-200{{ end }}"> {{ if $isCurrent }} bg-gray-light-200 dark:bg-gray-dark-200{{ end }}">
<a {{ if $isCurrent }}aria-current="page" {{ end }} class="py-2 w-full truncate block" <a {{ if $isCurrent }}aria-current="page" {{ end }} class="py-2 w-full truncate block"
href="{{ .Permalink }}" title="{{ markdownify .Title }}" href="{{ .Permalink }}" title="{{ .LinkTitle }}">
><span class="flex items-center gap-2">
{{ template "renderTitle" . }} {{ template "renderTitle" . }}
</span>
</a> </a>
</li> </li>
{{- end }} {{- end }}
@ -100,6 +85,6 @@
{{ define "renderTitle" }} {{ define "renderTitle" }}
{{ .LinkTitle }} {{ .LinkTitle }}
{{- with .Params.sidebar.badge }} {{- with .Params.sidebar.badge }}
{{- partial "components/badge.html" (dict "color" .color "content" .text) }} <span>{{- partial "components/badge.html" (dict "color" .color "content" .text) }}</span>
{{- end }} {{- end }}
{{ end }} {{ end }}

View File

@ -1,2 +1,3 @@
{{- .Page.Store.Set "youtube" true -}} {{- .Page.Store.Set "youtube" true -}}
<div id="youtube-player-{{ .Get 0 }}" data-video-id="{{ .Get 0 }}" class="youtube-video aspect-video w-full py-2"></div> <div id="youtube-player-{{ .Get 0 }}" data-video-id="{{ .Get 0 }}" class="youtube-video aspect-video h-fit w-full py-2">
</div>

33
package-lock.json generated
View File

@ -25,7 +25,8 @@
}, },
"devDependencies": { "devDependencies": {
"markdownlint": "^0.34.0", "markdownlint": "^0.34.0",
"prettier": "^3.3.2", "prettier": "^3.3.3",
"prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.6.5" "prettier-plugin-tailwindcss": "^0.6.5"
} }
}, },
@ -1404,9 +1405,9 @@
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.3.2", "version": "3.3.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin/prettier.cjs" "prettier": "bin/prettier.cjs"
@ -1418,6 +1419,21 @@
"url": "https://github.com/prettier/prettier?sponsor=1" "url": "https://github.com/prettier/prettier?sponsor=1"
} }
}, },
"node_modules/prettier-plugin-go-template": {
"version": "0.0.15",
"resolved": "https://registry.npmjs.org/prettier-plugin-go-template/-/prettier-plugin-go-template-0.0.15.tgz",
"integrity": "sha512-WqU92E1NokWYNZ9mLE6ijoRg6LtIGdLMePt2C7UBDjXeDH9okcRI3zRqtnWR4s5AloiqyvZ66jNBAa9tmRY5EQ==",
"dev": true,
"dependencies": {
"ulid": "^2.3.0"
},
"engines": {
"node": ">=14.0.0"
},
"peerDependencies": {
"prettier": "^3.0.0"
}
},
"node_modules/prettier-plugin-tailwindcss": { "node_modules/prettier-plugin-tailwindcss": {
"version": "0.6.5", "version": "0.6.5",
"resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.5.tgz", "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.5.tgz",
@ -1931,6 +1947,15 @@
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
"dev": true "dev": true
}, },
"node_modules/ulid": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/ulid/-/ulid-2.3.0.tgz",
"integrity": "sha512-keqHubrlpvT6G2wH0OEfSW4mquYRcbe/J8NMmveoQOjUqmo+hXtO+ORCpWhdbZ7k72UtY61BL7haGxW6enBnjw==",
"dev": true,
"bin": {
"ulid": "bin/cli.js"
}
},
"node_modules/unicorn-magic": { "node_modules/unicorn-magic": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz",

View File

@ -30,7 +30,8 @@
}, },
"devDependencies": { "devDependencies": {
"markdownlint": "^0.34.0", "markdownlint": "^0.34.0",
"prettier": "^3.3.2", "prettier": "^3.3.3",
"prettier-plugin-go-template": "^0.0.15",
"prettier-plugin-tailwindcss": "^0.6.5" "prettier-plugin-tailwindcss": "^0.6.5"
} }
} }