mirror of https://github.com/docker/docs.git
hugo: refactor sidebar templates
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
7f321a9197
commit
5eb0381ef1
|
@ -394,7 +394,6 @@
|
|||
"mt-1",
|
||||
"mt-2",
|
||||
"mt-20",
|
||||
"mt-4",
|
||||
"mx-auto",
|
||||
"my-0",
|
||||
"my-2",
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
</button>
|
||||
<!-- Actual Sidebar Content -->
|
||||
{{ block "left" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ $data := "" }}
|
||||
{{ if .Params.datafolder }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "content-default.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "content-default.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="prose min-w-0 flex-[2_2_0%] max-w-4xl dark:prose-invert">
|
||||
<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" }}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
{{ define "left" }}
|
||||
{{- partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
|
|
|
@ -12,7 +12,3 @@
|
|||
{{ partial "post-links.html" (where .CurrentSection.Pages "Permalink" "ne" page.Permalink) }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
{{ define "left" }}
|
||||
{{- partial "sidebar.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
<!-- Main navigation for the sidebar -->
|
||||
<div class="py-2 px-4" x-data="{ expanded: false }">
|
||||
<div class="flex w-full items-center justify-between">
|
||||
<a class="hover:text-blue-light dark:hover:text-blue-dark" href="{{ .FirstSection.Permalink }}">
|
||||
{{- with .FirstSection.Params.icon }}
|
||||
<!-- Current section: use menu, fall back to current page -->
|
||||
{{- $curr := page }}
|
||||
{{- range site.Menus.main }}
|
||||
{{- if .Page.IsAncestor page }}
|
||||
{{- $curr = .Page }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<a class="hover:text-blue-light dark:hover:text-blue-dark" href="{{ $curr.Permalink }}">
|
||||
{{- with $curr.Params.icon }}
|
||||
<span class="pr-2 icon-sm icon-svg">
|
||||
{{- partialCached "icon.html" . . -}}
|
||||
</span>
|
||||
{{- end }}
|
||||
{{- .FirstSection.LinkTitle -}}
|
||||
{{- $curr.LinkTitle -}}
|
||||
</a>
|
||||
<button @click="expanded = !expanded" class="rounded hover:bg-gray-light-300 hover:dark:bg-gray-dark-300">
|
||||
<span x-show="! expanded" class="icon-svg">
|
|
@ -1,6 +1,4 @@
|
|||
<!-- section tree -->
|
||||
{{ partial "sidebar-mainnav.html" . }}
|
||||
|
||||
<nav class="md:text-sm flex flex-col">
|
||||
<div
|
||||
class="block py-4 md:hidden text-gray-light dark:text-gray-dark">This section</div>
|
|
@ -1,5 +1,6 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar-tags.html" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/tags.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{ define "left" }}
|
||||
{{ partial "sidebar-tags.html" . }}
|
||||
{{ partial "sidebar/tags.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
|
|
Loading…
Reference in New Issue