chore: normalize mixed casing of code block lang and theme parameters (#647)
This commit is contained in:
parent
4b6ba3a53f
commit
23128a3dfa
29 changed files with 79 additions and 77 deletions
|
@ -16,7 +16,7 @@ This theme is subject to a CI driven build and release process common for softwa
|
|||
|
||||
Due to the fact that `webpack` and `npm scripts` are used as pre-processors, the theme cannot be used from the main branch by default. If you want to use the theme from a cloned branch instead of a release tarball you'll need to install `webpack` locally and run the build script once to create all required assets.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
# install required packages from package.json
|
||||
npm install
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{- $searchData := resources.Get "search/data.json" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify -}}
|
||||
{
|
||||
"dataFile": {{ $searchData.RelPermalink | jsonify }},
|
||||
"indexConfig": {{ .Site.Params.GeekdocSearchConfig | jsonify }},
|
||||
"showParent": {{ if .Site.Params.GeekdocSearchShowParent }}true{{ else }}false{{ end }},
|
||||
"showDescription": {{ if .Site.Params.GeekdocSearchshowDescription }}true{{ else }}false{{ end }}
|
||||
"indexConfig": {{ .Site.Params.geekdocSearchConfig | jsonify }},
|
||||
"showParent": {{ if .Site.Params.geekdocSearchShowParent }}true{{ else }}false{{ end }},
|
||||
"showDescription": {{ if .Site.Params.geekdocSearchshowDescription }}true{{ else }}false{{ end }}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[
|
||||
{{ range $index, $page := (where .Site.Pages "Params.GeekdocProtected" "ne" true) }}
|
||||
{{ range $index, $page := (where .Site.Pages "Params.geekdocProtected" "ne" true) }}
|
||||
{{ if ne $index 0 }},{{ end }}
|
||||
{
|
||||
"id": {{ $index }},
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
GeekdocHidden: true
|
||||
geekdocHidden: true
|
||||
---
|
||||
|
|
|
@ -21,21 +21,21 @@ To display an inline shortcode use single quotes:
|
|||
Code blocks can be uses without language specification:
|
||||
|
||||
````markdown
|
||||
```Plain
|
||||
```plain
|
||||
some code
|
||||
```
|
||||
````
|
||||
|
||||
**Example:**
|
||||
|
||||
```Plain
|
||||
```plain
|
||||
some code
|
||||
```
|
||||
|
||||
... or if you need language specific syntax highlighting:
|
||||
|
||||
````markdown
|
||||
```Shell
|
||||
```shell
|
||||
# some code
|
||||
echo "Hello world"
|
||||
```
|
||||
|
@ -43,7 +43,7 @@ echo "Hello world"
|
|||
|
||||
**Example:**
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
# some code
|
||||
echo "Hello World"
|
||||
```
|
||||
|
@ -55,7 +55,7 @@ Hugo has a build-in shortcode for syntax highlighting. To work properly with thi
|
|||
{{< tabs "uniqueid" >}}
|
||||
{{< tab "TOML" >}}
|
||||
|
||||
```TOML
|
||||
```toml
|
||||
pygmentsUseClasses=true
|
||||
pygmentsCodeFences=true
|
||||
```
|
||||
|
@ -63,7 +63,7 @@ pygmentsCodeFences=true
|
|||
{{< /tab >}}
|
||||
{{< tab "YAML" >}}
|
||||
|
||||
```YAML
|
||||
```yaml
|
||||
pygmentsUseClasses: true
|
||||
pygmentsCodeFences: true
|
||||
```
|
||||
|
|
|
@ -16,7 +16,7 @@ Regardless of which tool (or existing sprite) you choose, there are a few requir
|
|||
|
||||
The result of a valid minimal SVG sprite file could look like this:
|
||||
|
||||
```XML
|
||||
```xml
|
||||
<svg class="svg-sprite" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<symbol viewBox="-2.29 -2.29 28.57 28.57" id="arrow_back" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M24 10.526v2.947H5.755l8.351 8.421-2.105 2.105-12-12 12-12 2.105 2.105-8.351 8.421H24z"/>
|
||||
|
@ -28,7 +28,7 @@ The result of a valid minimal SVG sprite file could look like this:
|
|||
|
||||
FontAwesome provides three pre-build sprites included in the regular Web download pack, `sprites/brands.svg`, `sprites/regular.svg` and `sprites/solid.svg`. Choose your sprite to use and copy it to your projects root directory into `assets/sprites`, right beside your `content` folder:
|
||||
|
||||
```Bash
|
||||
```bash
|
||||
my_projcet/
|
||||
├── assets
|
||||
│ └── sprites
|
||||
|
|
|
@ -12,7 +12,7 @@ Hugo supports the creation of websites with multiple languages. In this post we
|
|||
|
||||
You need to set a default language and configure at least two different languages used by your site to your configuration file at `config.toml`:
|
||||
|
||||
```Toml
|
||||
```toml
|
||||
defaultContentLanguage = "en"
|
||||
|
||||
[languages.en]
|
||||
|
@ -34,7 +34,7 @@ To customize translation strings used by the theme you can create a file `i18n/<
|
|||
|
||||
For the [Bundle Menu](/usage/menus/#bundle-menu) as well as for the [Extra Header Menu](/usage/menus/#extra-header-menu) you can translate the name within the data file of the menu:
|
||||
|
||||
```YAML
|
||||
```yaml
|
||||
---
|
||||
more:
|
||||
# If `name` is a text, this text will be used as name for each language.
|
||||
|
|
|
@ -78,13 +78,13 @@ HTML content will be filtered by the `safeHTML` filter and added to the rendered
|
|||
In some situations, it can be helpful to include Markdown files that also contain shortcodes. While the [default method](#markdown-file-default) works fine to render plain Markdown, shortcodes are not parsed. The only way to get this to work is to use Hugo pages. There are several ways to structure these include pages, so whatever you do, keep in mind that Hugo needs to be able to render and serve these files as regular pages! How it works:
|
||||
|
||||
1. First you need to create a directory **within** your content directory. For this example site `_includes` is used.
|
||||
2. To prevent the theme from embedding the page in the navigation, create a file `_includes/_index.md` and add `GeekdocHidden: true` to the front matter.
|
||||
2. To prevent the theme from embedding the page in the navigation, create a file `_includes/_index.md` and add `geekdocHidden: true` to the front matter.
|
||||
3. Place your Markdown files within the `_includes` folder e.g. `/_includes/include-page.md`. Make sure to name it `*.md`.
|
||||
4. Include the page using `{{</* include file="/_includes/include-page.md" type="page" */>}}`.
|
||||
|
||||
Resulting structure should look like this:
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
_includes/
|
||||
├── include-page.md
|
||||
└── _index.md
|
||||
|
|
|
@ -10,7 +10,7 @@ weight: -10
|
|||
{{< tabs "site-config" >}}
|
||||
{{< tab "TOML" >}}
|
||||
|
||||
```Toml
|
||||
```toml
|
||||
baseURL = "http://localhost"
|
||||
title = "Geekdocs"
|
||||
theme = "hugo-geekdoc"
|
||||
|
@ -65,7 +65,7 @@ enableRobotsTXT = true
|
|||
# You can also specify this parameter per page in front matter.
|
||||
geekdocRepo = "https://github.com/thegeeklab/hugo"
|
||||
|
||||
# (Optional, default none) Enable 'Edit page' links. Requires 'GeekdocRepo' param
|
||||
# (Optional, default none) Enable 'Edit page' links. Requires 'geekdocRepo' param
|
||||
# and the path must point to the parent directory of the 'content' folder.
|
||||
# You can also specify this parameter per page in front matter.
|
||||
geekdocEditPath = "edit/main/exampleSite"
|
||||
|
@ -134,7 +134,7 @@ enableRobotsTXT = true
|
|||
{{< /tab >}}
|
||||
{{< tab "YAML" >}}
|
||||
|
||||
```Yaml
|
||||
```yaml
|
||||
---
|
||||
baseURL: "http://localhost"
|
||||
title: "Geekdocs"
|
||||
|
@ -191,7 +191,7 @@ params:
|
|||
# You can also specify this parameter per page in front matter.
|
||||
geekdocRepo: "https://github.com/thegeeklab/hugo-geekdoc"
|
||||
|
||||
# (Optional, default none) Enable 'Edit page' links. Requires 'GeekdocRepo' param
|
||||
# (Optional, default none) Enable 'Edit page' links. Requires 'geekdocRepo' param
|
||||
# and the path must point to the parent directory of the 'content' folder.
|
||||
# You can also specify this parameter per page in front matter.
|
||||
geekdocEditPath: edit/main/exampleSite
|
||||
|
@ -265,7 +265,7 @@ params:
|
|||
{{< tabs "page-config" >}}
|
||||
{{< tab "TOML" >}}
|
||||
|
||||
```Toml
|
||||
```toml
|
||||
# Set type to 'posts' if you want to render page as blogpost
|
||||
type = "posts"
|
||||
|
||||
|
@ -288,7 +288,7 @@ geekdocBreadcrumb = false
|
|||
# Set source repository location.
|
||||
geekdocRepo = "https://github.com/thegeeklab/hugo-geekdoc"
|
||||
|
||||
# Enable 'Edit page' links. Requires 'GeekdocRepo' param and the path must point to
|
||||
# Enable 'Edit page' links. Requires 'geekdocRepo' param and the path must point to
|
||||
# the parent directory of the 'content' folder.
|
||||
geekdocEditPath = "edit/main/exampleSite"
|
||||
|
||||
|
@ -325,7 +325,7 @@ geekdocAlign = "left"
|
|||
{{< /tab >}}
|
||||
{{< tab "YAML" >}}
|
||||
|
||||
```Yaml
|
||||
```yaml
|
||||
# Set type to 'posts' if you want to render page as blogpost.
|
||||
type: "posts"
|
||||
|
||||
|
@ -348,7 +348,7 @@ geekdocBreadcrumb: false
|
|||
# Set source repository location.
|
||||
geekdocRepo: "https://github.com/thegeeklab/hugo-geekdoc"
|
||||
|
||||
# Enable 'Edit page' links. Requires 'GeekdocRepo' param and the path must point to
|
||||
# Enable 'Edit page' links. Requires 'geekdocRepo' param and the path must point to
|
||||
# the parent directory of the 'content' folder.
|
||||
geekdocEditPath: "edit/main/exampleSite"
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ You need a recent version of Hugo for local builds and previews of sites that us
|
|||
|
||||
If you want to use the theme from a cloned branch instead of a release tarball you'll need to install `webpack` locally and run the build script once to create all required assets.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
# install required packages from package.json
|
||||
npm install
|
||||
|
||||
|
@ -32,13 +32,13 @@ To prepare your new site environment just a few steps are required:
|
|||
|
||||
1. Create a new empty Hugo site.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
hugo new site demosite
|
||||
```
|
||||
|
||||
2. Switch to the root of the new site.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
cd demosite
|
||||
```
|
||||
|
||||
|
@ -46,7 +46,7 @@ To prepare your new site environment just a few steps are required:
|
|||
|
||||
4. Create the minimal required Hugo configuration `config.toml`. For all configuration options take a look at the [configuration](/usage/configuration/) page.
|
||||
|
||||
```Toml
|
||||
```toml
|
||||
baseURL = "http://localhost"
|
||||
title = "Geekdocs"
|
||||
theme = "hugo-geekdoc"
|
||||
|
@ -76,7 +76,7 @@ To prepare your new site environment just a few steps are required:
|
|||
|
||||
5. Test your site.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
hugo server -D
|
||||
```
|
||||
|
||||
|
@ -84,7 +84,7 @@ To prepare your new site environment just a few steps are required:
|
|||
|
||||
Download and extract the latest release bundle into the theme directory.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
mkdir -p themes/hugo-geekdoc/
|
||||
curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1
|
||||
```
|
||||
|
@ -100,13 +100,13 @@ run the described steps as well.
|
|||
|
||||
Clone the Geekdoc git repository.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
git clone https://github.com/thegeeklab/hugo-geekdoc.git themes/hugo-geekdoc
|
||||
```
|
||||
|
||||
Build required theme assets e.g. CSS files and SVG sprites.
|
||||
|
||||
```Shell
|
||||
```shell
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
@ -123,7 +123,7 @@ Here are some possible solutions:
|
|||
|
||||
Add a Makefile to your repository to bundle the required steps.
|
||||
|
||||
```Makefile
|
||||
```makefile
|
||||
THEME_VERSION := v0.8.2
|
||||
THEME := hugo-geekdoc
|
||||
BASEDIR := docs
|
||||
|
|
|
@ -35,7 +35,7 @@ This type of navigation needs to be enabled first by setting `geekdocMenuBundle`
|
|||
|
||||
**Example:**
|
||||
|
||||
```YAML
|
||||
```yaml
|
||||
---
|
||||
main:
|
||||
- name: Level 1
|
||||
|
@ -77,7 +77,7 @@ As this is a special type of the bundle menu it is basically working in the same
|
|||
|
||||
**Example:**
|
||||
|
||||
```YAML
|
||||
```yaml
|
||||
---
|
||||
more:
|
||||
- name: News
|
||||
|
@ -99,7 +99,7 @@ If you want to customize the header menu, this can be achieved by using a data f
|
|||
|
||||
**Example:**
|
||||
|
||||
```Yaml
|
||||
```yaml
|
||||
---
|
||||
header:
|
||||
- name: GitHub
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- $showAnchor := (and (default true .Page.Params.GeekdocAnchor) (default true .Page.Site.Params.GeekdocAnchor)) -}}
|
||||
{{- $showAnchor := (and (default true .Page.Params.geekdocAnchor) (default true .Page.Site.Params.geekdocAnchor)) -}}
|
||||
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html
|
||||
lang="{{ .Site.Language.Lang }}"
|
||||
class="color-toggle-hidden"
|
||||
{{ if default false .Site.Params.GeekdocDarkModeCode }}code-theme="dark"{{ end }}
|
||||
{{ if default false .Site.Params.geekdocDarkModeCode }}code-theme="dark"{{ end }}
|
||||
>
|
||||
<head>
|
||||
{{ partial "head/meta" . }}
|
||||
|
@ -26,11 +26,11 @@
|
|||
|
||||
|
||||
<div
|
||||
class="wrapper {{ if default false .Site.Params.GeekdocDarkModeDim }}dark-mode-dim{{ end }}"
|
||||
class="wrapper {{ if default false .Site.Params.geekdocDarkModeDim }}dark-mode-dim{{ end }}"
|
||||
>
|
||||
<input type="checkbox" class="hidden" id="menu-control" />
|
||||
<input type="checkbox" class="hidden" id="menu-header-control" />
|
||||
{{ $navEnabled := default true .Page.Params.GeekdocNav }}
|
||||
{{ $navEnabled := default true .Page.Params.geekdocNav }}
|
||||
{{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }}
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
<article
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}"
|
||||
>
|
||||
<h1>{{ partial "utils/title" . }}</h1>
|
||||
{{ partial "utils/content" . }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
<article
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.GeekdocAlign | lower) }}"
|
||||
class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}"
|
||||
>
|
||||
<h1>{{ partial "utils/title" . }}</h1>
|
||||
{{ partial "utils/content" . }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
{{ if default true .Site.Params.geekdocSearch }}
|
||||
<script defer src="{{ index (index .Site.Data.assets "search.js") "src" | relURL }}"></script>
|
||||
{{- $searchConfigFile := printf "search/%s.config.json" .Language.Lang -}}
|
||||
{{- $searchConfig := resources.Get "search/config.json" | resources.ExecuteAsTemplate $searchConfigFile . | resources.Minify -}}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- if default true .Site.Params.GeekdocDarkModeToggle }}
|
||||
{{- if default true .Site.Params.geekdocDarkModeToggle }}
|
||||
<script src="{{ index (index .Site.Data.assets "colortheme.js") "src" | relURL }}"></script>
|
||||
{{- end }}
|
||||
<script src="{{ index (index .Site.Data.assets "main.js") "src" | relURL }}"></script>
|
||||
|
@ -66,7 +66,7 @@
|
|||
{{ printf `<link href=%q rel=%q type=%q />` .Permalink .Rel .MediaType.Type | safeHTML }}
|
||||
{{- end }}
|
||||
|
||||
{{- if (default false $.Site.Params.GeekdocOverwriteHTMLBase) }}
|
||||
{{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }}
|
||||
<base href="{{ .Site.BaseURL }}" />
|
||||
{{- end }}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
{{ $isCurrent := eq $current $this }}
|
||||
{{ $isAncestor := $this.IsAncestor $current }}
|
||||
{{ $id := substr (sha1 $this.Permalink) 0 8 }}
|
||||
{{ $doCollapse := and (isset . "sub") (or $this.Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
||||
{{ $doCollapse := and (isset . "sub") (or $this.Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
||||
|
||||
{{ $anchor := default "" .anchor }}
|
||||
{{ if $anchor }}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
|
||||
<ul class="gdoc-nav__list">
|
||||
{{ $sortBy := (default "title" .current.Site.Params.GeekdocFileTreeSortBy | lower) }}
|
||||
{{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }}
|
||||
{{ range .sect.GroupBy "Weight" }}
|
||||
{{ $rangeBy := .ByTitle }}
|
||||
|
||||
|
@ -39,13 +39,13 @@
|
|||
{{ end }}
|
||||
|
||||
{{ range $rangeBy }}
|
||||
{{ if not .Params.GeekdocHidden }}
|
||||
{{ if not .Params.geekdocHidden }}
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{ $isParent := and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
|
||||
{{ $isCurrent := eq $current . }}
|
||||
{{ $isAncestor := .IsAncestor $current }}
|
||||
{{ $id := substr (sha1 .Permalink) 0 8 }}
|
||||
{{ $doCollapse := and $isParent (or .Params.GeekdocCollapseSection (default false .Site.Params.GeekdocCollapseAllSections)) }}
|
||||
{{ $doCollapse := and $isParent (or .Params.geekdocCollapseSection (default false .Site.Params.geekdocCollapseAllSections)) }}
|
||||
|
||||
|
||||
<li>
|
||||
|
@ -63,7 +63,7 @@
|
|||
for="{{ printf "navtree-%s" $id }}" class="flex justify-between align-center"
|
||||
{{ end }}
|
||||
>
|
||||
{{ if or .Content .Params.GeekdocFlatSection }}
|
||||
{{ if or .Content .Params.geekdocFlatSection }}
|
||||
<span class="flex">
|
||||
<a
|
||||
href="{{ .RelPermalink }}"
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $showPrevNext := (and (default true .Site.Params.GeekdocNextPrev) .Site.Params.GeekdocMenuBundle) }}
|
||||
{{ $showPrevNext := (and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle) }}
|
||||
{{ if $showPrevNext }}
|
||||
<span class="gdoc-page__nav">
|
||||
{{ with ($current.Scratch.Get "prevPage") }}
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
<section class="gdoc-nav--main">
|
||||
<h2>{{ i18n "nav_navigation" }}</h2>
|
||||
{{ if .Site.Params.GeekdocMenuBundle }}
|
||||
{{ if .Site.Params.geekdocMenuBundle }}
|
||||
{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.main.main) }}
|
||||
{{ else }}
|
||||
{{ partial "menu-filetree" . }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
||||
{{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.GeekdocTagsToMenu) }}
|
||||
{{ if and (in (slice "posts" "tags") .Section) (default false .Site.Params.geekdocTagsToMenu) }}
|
||||
<section class="gdoc-nav--tags">
|
||||
<h2>{{ i18n "nav_tags" }}</h2>
|
||||
<ul class="gdoc-nav__list">
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{- with partial "utils/featured" . }}
|
||||
"thumbnailUrl": {{ . }},
|
||||
{{- end }}
|
||||
{{- with .Site.Params.GeekdocContentLicense }}
|
||||
{{- with .Site.Params.geekdocContentLicense }}
|
||||
"license": "{{ .name }}",
|
||||
{{- end }}
|
||||
"inLanguage": {{ .Lang }}
|
||||
|
@ -37,7 +37,7 @@
|
|||
"thumbnailUrl": {{ . }},
|
||||
{{- end }}
|
||||
"wordCount" : "{{ .WordCount }}",
|
||||
{{- with .Site.Params.GeekdocContentLicense }}
|
||||
{{- with .Site.Params.geekdocContentLicense }}
|
||||
"license": "{{ .name }}",
|
||||
{{- end }}
|
||||
"inLanguage": {{ .Lang }},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ $geekdocRepo := default (default false .Site.Params.GeekdocRepo) .Page.Params.GeekdocRepo }}
|
||||
{{ $geekdocEditPath := default (default false .Site.Params.GeekdocEditPath) .Page.Params.GeekdocEditPath }}
|
||||
{{ $geekdocRepo := default (default false .Site.Params.geekdocRepo) .Page.Params.geekdocRepo }}
|
||||
{{ $geekdocEditPath := default (default false .Site.Params.geekdocEditPath) .Page.Params.geekdocEditPath }}
|
||||
{{ if .File }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default (path.Join (default "content" .Site.Params.contentDir) .File.Path) .Page.Params.GeekdocFilePath) }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" (default (path.Join (default "content" .Site.Params.contentDir) .File.Path) .Page.Params.geekdocFilePath) }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "geekdocFilePath" false }}
|
||||
{{ end }}
|
||||
|
@ -18,7 +18,7 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $showBreadcrumb := (and (default true .Page.Params.GeekdocBreadcrumb) (default true .Site.Params.GeekdocBreadcrumb)) }}
|
||||
{{ $showBreadcrumb := (and (default true .Page.Params.geekdocBreadcrumb) (default true .Site.Params.geekdocBreadcrumb)) }}
|
||||
{{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }}
|
||||
<div
|
||||
class="gdoc-page__header flex flex-wrap
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{ if default true .Site.Params.GeekdocSearch }}
|
||||
{{ if default true .Site.Params.geekdocSearch }}
|
||||
<div class="gdoc-search flex align-center">
|
||||
<svg class="gdoc-icon gdoc_search"><use xlink:href="#gdoc_search"></use></svg>
|
||||
<input
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
<span class="gdoc-footer__item gdoc-footer__item--row">
|
||||
{{ i18n "footer_build_with" | safeHTML }}
|
||||
</span>
|
||||
{{ with .Site.Params.GeekdocLegalNotice }}
|
||||
{{ with .Site.Params.geekdocLegalNotice }}
|
||||
<span class="gdoc-footer__item gdoc-footer__item--row">
|
||||
<a href="{{ . | relURL }}" class="gdoc-footer__link">
|
||||
{{ i18n "footer_legal_notice" }}
|
||||
</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.GeekdocPrivacyPolicy }}
|
||||
{{ with .Site.Params.geekdocPrivacyPolicy }}
|
||||
<span class="gdoc-footer__item gdoc-footer__item--row">
|
||||
<a href="{{ . | relURL }}" class="gdoc-footer__link">
|
||||
{{ i18n "footer_privacy_policy" }}
|
||||
|
@ -20,7 +20,7 @@
|
|||
</span>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ with .Site.Params.GeekdocContentLicense }}
|
||||
{{ with .Site.Params.geekdocContentLicense }}
|
||||
<section class="flex flex-wrap align-center">
|
||||
<span class="gdoc-footer__item">
|
||||
{{ i18n "footer_content_license_prefix" }}
|
||||
|
@ -29,7 +29,7 @@
|
|||
</section>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ if (default true .Site.Params.GeekdocBackToTop) }}
|
||||
{{ if (default true .Site.Params.geekdocBackToTop) }}
|
||||
<div class="flex flex-25 justify-end">
|
||||
<span class="gdoc-footer__item text-right">
|
||||
<a class="gdoc-footer__link fake-link" href="#" aria-label="{{ i18n "nav_top" }}">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<span class="flex align-center">
|
||||
<img
|
||||
class="gdoc-brand__img"
|
||||
src="{{ (default "brand.svg" .Root.Site.Params.GeekdocLogo) | relURL }}"
|
||||
src="{{ (default "brand.svg" .Root.Site.Params.geekdocLogo) | relURL }}"
|
||||
alt=""
|
||||
/>
|
||||
<span class="gdoc-brand__title">{{ .Root.Site.Title }}</span>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }}
|
||||
{{- $customAlt := .Get "alt" }}
|
||||
{{- $customSize := .Get "size" | lower }}
|
||||
{{- $lazyLoad := default (default true $.Site.Params.GeekdocImageLazyLoading) (.Get "lazy") }}
|
||||
{{- $lazyLoad := default (default true $.Site.Params.geekdocImageLazyLoading) (.Get "lazy") }}
|
||||
{{- $data := newScratch }}
|
||||
|
||||
{{- with $source }}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{{- $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
|
||||
{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }}
|
||||
|
||||
{{- if $tocLevels }}
|
||||
<div class="gdoc-toc gdoc-toc__level--{{ $tocLevels }}">
|
||||
|
@ -12,23 +12,25 @@
|
|||
<ul>
|
||||
{{- range .sect.GroupBy "Weight" }}
|
||||
{{- range .ByTitle }}
|
||||
{{- if or (not .Params.GeekdocHidden) (not (default true .Params.GeekdocHiddenTocTree)) }}
|
||||
{{- if or (not .Params.geekdocHidden) (not (default true .Params.geekdocHiddenTocTree)) }}
|
||||
<li>
|
||||
{{- if or .Content .Params.GeekdocFlatSection }}
|
||||
{{- if or .Content .Params.geekdocFlatSection }}
|
||||
<span>
|
||||
<a href="{{ .RelPermalink }}" class="gdoc-toc__entry">
|
||||
{{- partial "utils/title" . }}{{ with .Params.GeekdocDescription }}:{{ end }}
|
||||
{{- partial "utils/title" . }}{{ with .Params.geekdocDescription }}:{{ end }}
|
||||
</a>
|
||||
{{- with .Params.GeekdocDescription }}{{ . }}{{ end }}
|
||||
{{- with .Params.geekdocDescription }}{{ . }}{{ end }}
|
||||
</span>
|
||||
{{- else -}}
|
||||
<span>
|
||||
{{- partial "utils/title" . }}{{ with .Params.GeekdocDescription }}: {{ . }}{{ end }}
|
||||
{{- partial "utils/title" . }}{{ with .Params.geekdocDescription }}
|
||||
: {{ . }}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{- end -}}
|
||||
|
||||
{{- $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{- if and (ne $numberOfPages 0) (not .Params.GeekdocFlatSection) }}
|
||||
{{- if and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }}
|
||||
{{- template "toc-tree" dict "sect" .Pages }}
|
||||
{{- end }}
|
||||
</li>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{- $format := default "html" (.Get "format") }}
|
||||
{{- $tocLevels := default (default 6 .Site.Params.GeekdocToC) .Page.Params.GeekdocToC }}
|
||||
{{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }}
|
||||
|
||||
{{- if and $tocLevels .Page.TableOfContents -}}
|
||||
{{- if not (eq ($format | lower) "raw") -}}
|
||||
|
|
Loading…
Reference in a new issue