mirror of
https://github.com/docker/docs.git
synced 2026-03-27 06:18:55 +07:00
site: simplify guides/series layouts
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
@@ -60,6 +60,32 @@ params:
|
||||
---
|
||||
```
|
||||
|
||||
### Series (guide) pages
|
||||
|
||||
Section pages under `content/guides/` automatically use the `series` layout
|
||||
(via a Hugo cascade in `hugo.yaml`). Series pages support additional front
|
||||
matter parameters for the metadata card:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: Getting started
|
||||
description: Learn the basics of Docker
|
||||
summary: |
|
||||
A longer summary shown on the series landing page.
|
||||
params:
|
||||
proficiencyLevel: Beginner
|
||||
time: 15 minutes
|
||||
prerequisites: None
|
||||
---
|
||||
```
|
||||
|
||||
| Field | Description |
|
||||
| ---------------- | ---------------------------------------- |
|
||||
| summary | Extended description for the series page |
|
||||
| proficiencyLevel | Skill level (Beginner, Intermediate) |
|
||||
| time | Estimated time to complete |
|
||||
| prerequisites | Prerequisites or "None" |
|
||||
|
||||
## Shortcodes
|
||||
|
||||
Shortcodes are reusable components that add rich functionality to your
|
||||
|
||||
@@ -13,9 +13,9 @@ summary: |
|
||||
deep dive into the secrets of images, how they are built and best practices.
|
||||
layout: series
|
||||
params:
|
||||
skill: Beginner
|
||||
proficiencyLevel: Beginner
|
||||
time: 25 minutes
|
||||
prereq: None
|
||||
prerequisites: None
|
||||
---
|
||||
|
||||
## About this series
|
||||
|
||||
@@ -12,9 +12,9 @@ summary: |
|
||||
commands, image creation, and container orchestration.
|
||||
layout: series
|
||||
params:
|
||||
skill: Beginner
|
||||
proficiencyLevel: Beginner
|
||||
time: 15 minutes
|
||||
prereq: None
|
||||
prerequisites: None
|
||||
aliases:
|
||||
- /guides/getting-started/
|
||||
---
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
cascade:
|
||||
build:
|
||||
render: never
|
||||
---
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: C#
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/csharp/csharp-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: C++
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/cplusplus/cplusplus-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Go
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/go/go-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Java
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/java/java-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: JavaScript
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/javascript/javascript-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: PHP
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/php/php-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Python
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/python/python-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: R
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/r/r-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Ruby
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/ruby/ruby-original.svg
|
||||
---
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: Rust
|
||||
params:
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/rust/rust-original.svg
|
||||
---
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Tags
|
||||
params:
|
||||
icon: tag
|
||||
---
|
||||
|
||||
Here you can browse Docker docs by tag.
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Administration
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: AI
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: App development
|
||||
---
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Best practices
|
||||
description: Optimal patterns for Docker
|
||||
---
|
||||
|
||||
Best practices articles describe methods and techniques that are generally
|
||||
the most idiomatic and optimized way to do something.
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Cloud services
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Data science
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Databases
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Deployment
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: DevOps
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Docker Hardened Images
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Distributed systems
|
||||
---
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: FAQ
|
||||
description: Frequently asked questions
|
||||
---
|
||||
|
||||
FAQs contain frequently asked questions about all things Docker, from accounts
|
||||
and administration to organization management, Docker Desktop, Docker Compose,
|
||||
and more.
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Frameworks
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Networking
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Observability
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
title: Product demo
|
||||
---
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: Release notes
|
||||
icon: note_stack_add
|
||||
description: Find out about the latest features
|
||||
aliases:
|
||||
- /release-notes/
|
||||
---
|
||||
|
||||
Release notes describe corrections, changes or enhancements made to a product
|
||||
product in a given release.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
title: Secrets
|
||||
description: Use sensitive information in containers securely
|
||||
---
|
||||
|
||||
A secret is a piece of data, such as a password, SSH private key, SSL
|
||||
certificate, or anything that should not be transmitted over a network or
|
||||
stored unencrypted in a Dockerfile or in your application's source code.
|
||||
|
||||
Docker provides specially designated features for managing secrets.
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
title: Troubleshooting
|
||||
description: Fix common issues
|
||||
---
|
||||
|
||||
Troubleshooting articles contain guidelines for solving common problems and
|
||||
pitfalls that you might encounter with Docker products.
|
||||
30
data/languages.yaml
Normal file
30
data/languages.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
c-sharp:
|
||||
title: "C#"
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/csharp/csharp-original.svg
|
||||
cpp:
|
||||
title: C++
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/cplusplus/cplusplus-original.svg
|
||||
go:
|
||||
title: Go
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/go/go-original.svg
|
||||
java:
|
||||
title: Java
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/java/java-original.svg
|
||||
js:
|
||||
title: JavaScript
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/javascript/javascript-original.svg
|
||||
php:
|
||||
title: PHP
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/php/php-original.svg
|
||||
python:
|
||||
title: Python
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/python/python-original.svg
|
||||
r:
|
||||
title: R
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/r/r-original.svg
|
||||
ruby:
|
||||
title: Ruby
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/ruby/ruby-original.svg
|
||||
rust:
|
||||
title: Rust
|
||||
icon: https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/rust/rust-original.svg
|
||||
38
data/tags.yaml
Normal file
38
data/tags.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
admin:
|
||||
title: Administration
|
||||
ai:
|
||||
title: AI
|
||||
app-dev:
|
||||
title: App development
|
||||
best-practices:
|
||||
title: Best practices
|
||||
cloud-services:
|
||||
title: Cloud services
|
||||
data-science:
|
||||
title: Data science
|
||||
databases:
|
||||
title: Databases
|
||||
deploy:
|
||||
title: Deployment
|
||||
devops:
|
||||
title: DevOps
|
||||
dhi:
|
||||
title: Docker Hardened Images
|
||||
distributed-systems:
|
||||
title: Distributed systems
|
||||
faq:
|
||||
title: FAQ
|
||||
frameworks:
|
||||
title: Frameworks
|
||||
networking:
|
||||
title: Networking
|
||||
observability:
|
||||
title: Observability
|
||||
product-demo:
|
||||
title: Product demo
|
||||
release-notes:
|
||||
title: Release notes
|
||||
secrets:
|
||||
title: Secrets
|
||||
troubleshooting:
|
||||
title: Troubleshooting
|
||||
@@ -8,9 +8,7 @@ disableHugoGeneratorInject: true
|
||||
ignoreLogs:
|
||||
- cascade-pattern-with-extension
|
||||
|
||||
taxonomies:
|
||||
tag: tags
|
||||
language: languages
|
||||
taxonomies: {}
|
||||
|
||||
# Remove the /manuals prefix for content in the manuals section
|
||||
permalinks:
|
||||
@@ -92,10 +90,6 @@ outputs:
|
||||
section:
|
||||
- html
|
||||
- markdown
|
||||
taxonomy:
|
||||
- html
|
||||
term:
|
||||
- html
|
||||
|
||||
languages:
|
||||
en:
|
||||
|
||||
@@ -5,11 +5,4 @@
|
||||
<div id="TableOfContents" class="overflow-x-auto">
|
||||
{{ partialCached "pagemeta.html" . . }}
|
||||
</div>
|
||||
{{- if ne .Type "guides" }}
|
||||
{{ with .GetTerms "tags" }}
|
||||
<div class="not-prose mt-8 px-4 overflow-x-auto">
|
||||
{{- partial "tags.html" . }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</aside>
|
||||
</aside>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<div class="not-prose">
|
||||
<div
|
||||
class="mt-1.5 mb-1.5 flex flex-col gap-4 rounded-sm bg-gray-100 p-6 sm:flex-row dark:bg-gray-800"
|
||||
>
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Skill level</strong></span>
|
||||
<span>{{ .Params.skill }}</span>
|
||||
</div>
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Time to complete</strong></span>
|
||||
<span>{{ .Params.time }}</span>
|
||||
</div>
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Prerequisites</strong></span>
|
||||
<span>{{ .Params.prereq }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -12,6 +12,17 @@
|
||||
<hr />
|
||||
</div>
|
||||
{{ .Content }}
|
||||
{{- if and (eq .Type "guides") (not .IsSection) (ne .CurrentSection .FirstSection) -}}
|
||||
{{- with .PrevInSection -}}
|
||||
<div class="not-prose col-start-2 my-4">
|
||||
<a
|
||||
href="{{ .Permalink }}"
|
||||
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"
|
||||
>{{ .Title }} »</a
|
||||
>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</article>
|
||||
<div class="-mt-8 hidden min-w-48 flex-1 lg:block">
|
||||
{{ partial "aside.html" . }}
|
||||
|
||||
15
layouts/_partials/guide-languages.html
Normal file
15
layouts/_partials/guide-languages.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- range . -}}
|
||||
{{- $lang := index site.Data.languages . -}}
|
||||
{{- with $lang }}
|
||||
<span class="chip">
|
||||
<img
|
||||
class="py-1"
|
||||
height="18"
|
||||
width="18"
|
||||
title="{{ .title }}"
|
||||
src="{{ .icon }}"
|
||||
/>
|
||||
<span>{{ .title }}</span>
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
9
layouts/_partials/guide-tags.html
Normal file
9
layouts/_partials/guide-tags.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- range . -}}
|
||||
{{- $tag := index site.Data.tags . -}}
|
||||
{{- with $tag }}
|
||||
<span class="chip">
|
||||
<span class="icon-svg icon-sm pb-0.5">{{ partialCached "icon" "tag" "tag" }}</span>
|
||||
{{ .title }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -1,23 +0,0 @@
|
||||
{{- /*
|
||||
List of languages (taxonomy) chips with images
|
||||
Context: page.Pages
|
||||
*/
|
||||
-}}
|
||||
{{- range . -}}
|
||||
{{- if eq .File nil }}
|
||||
{{- errorf "[languages] Undefined language: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
|
||||
{{- end }}
|
||||
{{- if not .Page.Params.icon }}
|
||||
{{- errorf "[languages] language is missing an icon: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
|
||||
{{- end }}
|
||||
<span class="chip">
|
||||
<img
|
||||
class="py-1"
|
||||
height="18"
|
||||
width="18"
|
||||
title="{{ .Page.LinkTitle }}"
|
||||
src="{{ .Page.Params.icon }}"
|
||||
/>
|
||||
<span>{{ .Page.LinkTitle }}</span>
|
||||
</span>
|
||||
{{- end -}}
|
||||
@@ -43,6 +43,16 @@
|
||||
{{- $schema = merge $schema (dict "keywords" .) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Add proficiency level if specified in frontmatter */ -}}
|
||||
{{- with .Params.proficiencyLevel -}}
|
||||
{{- $schema = merge $schema (dict "proficiencyLevel" .) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Add prerequisites if specified in frontmatter */ -}}
|
||||
{{- with .Params.prerequisites -}}
|
||||
{{- $schema = merge $schema (dict "dependencies" .) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Add time required if specified in frontmatter */ -}}
|
||||
{{- with .Params.time -}}
|
||||
{{- /* Convert "20 minutes" to ISO 8601 duration "PT20M" */ -}}
|
||||
|
||||
@@ -1,33 +1,19 @@
|
||||
{{- /*
|
||||
Renders a sidebar for pages in the `/guides` section.
|
||||
- Detects if the current page is part of a multipage guide (`.Store.Set "multipage"`).
|
||||
- Displays the section's title, summary, languages, tags, and estimated time (`Params.time`).
|
||||
- Includes a stepper navigation (`guides-stepper.html`) for multipage guides.
|
||||
- Optionally lists resource links from `Params.resource_links`.
|
||||
- Provides a link back to the main `/guides/` index.
|
||||
*/
|
||||
-}}
|
||||
{{- $guide := cond (eq .CurrentSection .FirstSection) . .CurrentSection -}}
|
||||
<div class="flex flex-col gap-4 px-4 pt-2">
|
||||
{{- $root := . }}
|
||||
{{- .Store.Set "multipage" false }}
|
||||
{{- if ne .CurrentSection .FirstSection }}
|
||||
{{- $root = .CurrentSection }}
|
||||
{{- .Store.Set "multipage" true }}
|
||||
{{- end }}
|
||||
<div class="font-semibold">
|
||||
<a href="{{ $root.Permalink }}">{{ $root.Title }}</a>
|
||||
<a href="{{ $guide.Permalink }}">{{ $guide.Title }}</a>
|
||||
</div>
|
||||
<div>{{ $root.Summary }}</div>
|
||||
<div>{{ $guide.Summary }}</div>
|
||||
<div class="space-y-4">
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{{- with ($root.GetTerms "languages") }}
|
||||
{{ partial "languages.html" . }}
|
||||
{{- with $guide.Params.languages }}
|
||||
{{ partial "guide-languages.html" . }}
|
||||
{{- end }}
|
||||
{{- with ($root.GetTerms "tags") }}
|
||||
{{ partial "tags.html" . }}
|
||||
{{- with $guide.Params.tags }}
|
||||
{{ partial "guide-tags.html" . }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- with ($root.Params.time) }}
|
||||
{{- with $guide.Params.time }}
|
||||
<div class="flex gap-2 text-gray-400 dark:text-gray-400">
|
||||
<span class="icon-svg"
|
||||
>{{ partialCached "icon" "schedule" "schedule" }}</span
|
||||
@@ -36,10 +22,10 @@
|
||||
</div>
|
||||
{{- end -}}
|
||||
</div>
|
||||
{{- if (.Store.Get "multipage") }}
|
||||
{{- if gt (len $guide.Pages) 0 }}
|
||||
{{- partial "guides-stepper.html" . }}
|
||||
{{- end }}
|
||||
{{- with $root.Params.resource_links }}
|
||||
{{- with $guide.Params.resource_links }}
|
||||
<div class="space-y-2">
|
||||
<p>Resources:</p>
|
||||
<ul class="ml-4 space-y-2">
|
||||
@@ -49,5 +35,5 @@
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
||||
<a href="/guides/" class="link mt-2">« Back to all guides</a>
|
||||
<a href="/guides/" class="link mt-2">« Back to all guides</a>
|
||||
</div>
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{{- /*
|
||||
Renders a flat list of tags for the "tags" taxonomy.
|
||||
- Unlike `sections.html`, this template is based on taxonomy terms, not section pages.
|
||||
- Highlights the current tag page and links to all tag pages.
|
||||
*/
|
||||
-}}
|
||||
<ul class="md:text-sm">
|
||||
{{- range site.Taxonomies.tags }}
|
||||
<li
|
||||
class="hover:text-blue {{ if eq .Page page }}
|
||||
bg-gray-400 dark:bg-gray-800
|
||||
{{ end }} pl-4 hover:dark:text-blue-700"
|
||||
>
|
||||
<a
|
||||
class="block w-full truncate py-2"
|
||||
href="{{ .Page.Permalink }}"
|
||||
title="{{ .Page.LinkTitle }}"
|
||||
>
|
||||
{{ .Page.LinkTitle }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
@@ -1,16 +0,0 @@
|
||||
{{- /*
|
||||
List of tag "chips" as links
|
||||
Context: page.Pages
|
||||
*/
|
||||
-}}
|
||||
{{- range . -}}
|
||||
{{- if eq .File nil }}
|
||||
{{- errorf "[tags] Undefined tag: '%s' in %s" (urlize (strings.ToLower .Title)) page.File.Filename }}
|
||||
{{- end }}
|
||||
<a class="chip" href="{{ .Permalink }}">
|
||||
<span class="icon-svg icon-sm pb-0.5">
|
||||
{{ partialCached "icon" "tag" "tag" }}
|
||||
</span>
|
||||
<span>{{ .LinkTitle }}</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
@@ -53,7 +53,11 @@
|
||||
<!-- Actual Sidebar Content -->
|
||||
{{ block "left" . }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ if eq .Type "guides" }}
|
||||
{{ partial "sidebar/guides.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
>
|
||||
<div class="pl-2"><strong>Tags</strong></div>
|
||||
<fieldset class="flex flex-col gap-2">
|
||||
{{- range $name, $taxonomy := where site.Taxonomies.tags ".Page.Section" "guides" }}
|
||||
{{- range $name, $data := site.Data.tags }}
|
||||
{{- $id := anchorize (fmt.Printf "tag-%s" $name) }}
|
||||
<div class="flex gap-2 pl-2">
|
||||
<input
|
||||
@@ -51,14 +51,14 @@
|
||||
:checked="filters['tags'].includes('{{ $name }}')"
|
||||
/>
|
||||
<label class="select-none" for="{{ $id }}"
|
||||
>{{ .Page.LinkTitle }}</label
|
||||
>{{ $data.title }}</label
|
||||
>
|
||||
</div>
|
||||
{{ end }}
|
||||
</fieldset>
|
||||
<div class="pl-2"><strong>Languages</strong></div>
|
||||
<fieldset class="flex flex-wrap gap-2 pl-2">
|
||||
{{- range $name, $taxonomy := where site.Taxonomies.languages ".Page.Type" "guides" }}
|
||||
{{- range $name, $data := site.Data.languages }}
|
||||
{{- $id := anchorize (fmt.Printf "lang-%s" $name) }}
|
||||
<button
|
||||
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,10 +68,10 @@
|
||||
<img
|
||||
height="18"
|
||||
width="18"
|
||||
title="{{ .Page.LinkTitle }}"
|
||||
src="{{ .Page.Params.icon }}"
|
||||
title="{{ $data.title }}"
|
||||
src="{{ $data.icon }}"
|
||||
/>
|
||||
<span>{{ .Page.LinkTitle }}</span>
|
||||
<span>{{ $data.title }}</span>
|
||||
</button>
|
||||
{{ end }}
|
||||
</fieldset>
|
||||
@@ -189,12 +189,12 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 pl-4">
|
||||
{{- range $name, $taxonomy := site.Taxonomies.tags }}
|
||||
{{- range $name, $data := site.Data.tags }}
|
||||
<div x-show="filters.tags.includes('{{ $name }}')">
|
||||
{{ template "termchip" $taxonomy.Page.LinkTitle }}
|
||||
{{ template "termchip" $data.title }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- range $name, $taxonomy := site.Taxonomies.languages }}
|
||||
{{- range $name, $data := site.Data.languages }}
|
||||
<div
|
||||
x-show="filters.languages.includes('{{ $name }}')"
|
||||
class="border-divider-light dark:border-divider-dark inline-flex items-center gap-1 rounded-full border bg-gray-100 px-2 text-sm text-gray-200 select-none dark:bg-gray-800 dark:text-gray-300"
|
||||
@@ -203,10 +203,10 @@
|
||||
class="py-1"
|
||||
height="18"
|
||||
width="18"
|
||||
title="{{ .Page.LinkTitle }}"
|
||||
src="{{ .Page.Params.icon }}"
|
||||
title="{{ $data.title }}"
|
||||
src="{{ $data.icon }}"
|
||||
/>
|
||||
<span>{{ .Page.LinkTitle }}</span>
|
||||
<span>{{ $data.title }}</span>
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
@@ -241,11 +241,11 @@
|
||||
class="flex items-center justify-between gap-8 text-sm text-gray-400 dark:text-gray-300"
|
||||
>
|
||||
<div class="flex flex-wrap gap-2 md:flex-nowrap">
|
||||
{{- $langs := .GetTerms "languages" }}
|
||||
{{ partial "languages" $langs }}
|
||||
{{- $tags := .GetTerms "tags" }}
|
||||
{{- range $tags }}
|
||||
{{ template "termchip" .Page.LinkTitle }}
|
||||
{{- with .Params.languages }}
|
||||
{{ partial "guide-languages.html" . }}
|
||||
{{- end }}
|
||||
{{- with .Params.tags }}
|
||||
{{ partial "guide-tags.html" . }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- with .Params.time }}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/guides.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="prose min-w-0 max-w-4xl dark:prose-invert">
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
@@ -14,7 +9,7 @@
|
||||
{{ .Content }}
|
||||
{{ partial "heading.html" (dict "text" "Modules" "level" 2) }}
|
||||
<ol>
|
||||
{{- range $i, $e := .Pages }}
|
||||
{{- range .Pages }}
|
||||
<li>
|
||||
<a class="link" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
<p>{{ plainify .Description }}</p>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/guides.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "content-default.html" . }}
|
||||
<div class="prose dark:prose-invert max-w-4xl">
|
||||
{{ if (.Store.Get "multipage") }}
|
||||
{{- with .PrevInSection }}
|
||||
<div class="not-prose col-start-2 my-4">
|
||||
<a
|
||||
href="{{ .Permalink }}"
|
||||
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"
|
||||
>{{ .Title }} »</a
|
||||
>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -4,8 +4,11 @@
|
||||
{{- $desc := partialCached "utils/description.html" . . -}}
|
||||
{{- $kwd := partialCached "utils/keywords.html" . . -}}
|
||||
{{- $tags := slice -}}
|
||||
{{- range (.GetTerms "tags") -}}
|
||||
{{ $tags = $tags | append .LinkTitle }}
|
||||
{{- range (.Params.tags | default slice) -}}
|
||||
{{- $tagData := index site.Data.tags . -}}
|
||||
{{- with $tagData -}}
|
||||
{{ $tags = $tags | append .title }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- jsonify (dict "url" .Permalink "title" $title "description" $desc "keywords" $kwd "tags" $tags) -}},
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/sections.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<article class="prose dark:prose-invert max-w-none">
|
||||
|
||||
@@ -3,14 +3,39 @@
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
<h1 data-pagefind-weight="10" class="scroll-mt-36">{{ .Title }}</h1>
|
||||
<div class="text-lg">{{ .Summary }}</div>
|
||||
{{ partial "components/guide-summary.html" . }}
|
||||
{{- if or .Params.proficiencyLevel .Params.time .Params.prerequisites }}
|
||||
<div class="not-prose">
|
||||
<div class="mt-1.5 mb-1.5 flex flex-col gap-4 rounded-sm bg-gray-100 p-6 sm:flex-row dark:bg-gray-800">
|
||||
{{- with .Params.proficiencyLevel }}
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Skill level</strong></span>
|
||||
<span>{{ . }}</span>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- with .Params.time }}
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Time to complete</strong></span>
|
||||
<span>{{ . }}</span>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- with .Params.prerequisites }}
|
||||
<div class="flex flex-grow flex-col sm:items-center">
|
||||
<span><strong>Prerequisites</strong></span>
|
||||
<span>{{ . }}</span>
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ .Content }}
|
||||
{{ partial "heading.html" (dict "text" "Modules" "level" 2) }}
|
||||
{{ range $i, $e := .Pages }}
|
||||
{{ $o := compare.Conditional (eq $i 0) true false }}
|
||||
{{ $t := fmt.Printf "%d. %s" (add $i 1) $e.Title }}
|
||||
{{ $b := fmt.Printf "%s\n\n{{< button url=`%s` text=`%s` >}}" $e.Summary $e.Permalink "Start" }}
|
||||
{{ partial "components/accordion.html" (dict "large" true "open" $o "title" $t "body" $b) }}
|
||||
{{ end }}
|
||||
<ol>
|
||||
{{- range .Pages }}
|
||||
<li>
|
||||
<a class="link" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
<p>{{ plainify .Description }}</p>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ol>
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/tags.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="prose dark:prose-invert max-w-none">
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<h1 class="flex items-center">
|
||||
<span class="icon-svg icon-lg pb-2"
|
||||
>{{ partialCached "icon" "tag" "tag" }}</span
|
||||
>
|
||||
<span>{{ .Title }}</span>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ range site.Taxonomies.tags }}
|
||||
<li>
|
||||
<a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
|
||||
({{ (len .Pages) }} {{ cond (gt (len .Pages) 1) "pages" "page" }})
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</article>
|
||||
{{ end }}
|
||||
@@ -1,25 +0,0 @@
|
||||
{{ define "left" }}
|
||||
{{ partial "sidebar/mainnav.html" . }}
|
||||
{{ partial "sidebar/tags.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<h1 class="flex items-center">
|
||||
<span class="icon-svg icon-lg pb-2">{{ partialCached "icon" "tag" "tag" }}</span>
|
||||
</span>{{ .Title }}</span>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
{{- range .Pages.GroupBy "Type" }}
|
||||
<h2>{{ (site.GetPage .Key).LinkTitle }}</h2>
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user