diff --git a/README.md b/README.md index 8ab84a8..7dd7bd4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/assets/search/config.json b/assets/search/config.json index 831c8d1..1a5582a 100644 --- a/assets/search/config.json +++ b/assets/search/config.json @@ -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 }} } diff --git a/assets/search/data.json b/assets/search/data.json index eeebaa6..f1c0e80 100644 --- a/assets/search/data.json +++ b/assets/search/data.json @@ -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 }}, diff --git a/exampleSite/content/en/_includes/_index.md b/exampleSite/content/en/_includes/_index.md index 9b76178..9676d05 100644 --- a/exampleSite/content/en/_includes/_index.md +++ b/exampleSite/content/en/_includes/_index.md @@ -1,3 +1,3 @@ --- -GeekdocHidden: true +geekdocHidden: true --- diff --git a/exampleSite/content/en/features/code-blocks.md b/exampleSite/content/en/features/code-blocks.md index 5964122..63595d7 100644 --- a/exampleSite/content/en/features/code-blocks.md +++ b/exampleSite/content/en/features/code-blocks.md @@ -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 ``` diff --git a/exampleSite/content/en/features/icon-sets.md b/exampleSite/content/en/features/icon-sets.md index 6f84b74..7d3441e 100644 --- a/exampleSite/content/en/features/icon-sets.md +++ b/exampleSite/content/en/features/icon-sets.md @@ -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 @@ -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 diff --git a/exampleSite/content/en/features/multilingual/_index.md b/exampleSite/content/en/features/multilingual/_index.md index f60431b..dd16337 100644 --- a/exampleSite/content/en/features/multilingual/_index.md +++ b/exampleSite/content/en/features/multilingual/_index.md @@ -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. diff --git a/exampleSite/content/en/shortcodes/includes.md b/exampleSite/content/en/shortcodes/includes.md index 8294687..25ad079 100644 --- a/exampleSite/content/en/shortcodes/includes.md +++ b/exampleSite/content/en/shortcodes/includes.md @@ -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 `{{}}`. Resulting structure should look like this: -```Shell +```shell _includes/ ├── include-page.md └── _index.md diff --git a/exampleSite/content/en/usage/configuration.md b/exampleSite/content/en/usage/configuration.md index 094c4b7..b9639f9 100644 --- a/exampleSite/content/en/usage/configuration.md +++ b/exampleSite/content/en/usage/configuration.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" diff --git a/exampleSite/content/en/usage/getting-started.md b/exampleSite/content/en/usage/getting-started.md index ff6ea17..c5df602 100644 --- a/exampleSite/content/en/usage/getting-started.md +++ b/exampleSite/content/en/usage/getting-started.md @@ -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 diff --git a/exampleSite/content/en/usage/menus.md b/exampleSite/content/en/usage/menus.md index a9288a8..8fe0168 100644 --- a/exampleSite/content/en/usage/menus.md +++ b/exampleSite/content/en/usage/menus.md @@ -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 diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 548ede6..f947f96 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -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)) -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 2c953f4..ebc39cf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,7 +2,7 @@ {{ partial "head/meta" . }} @@ -26,11 +26,11 @@
- {{ $navEnabled := default true .Page.Params.GeekdocNav }} + {{ $navEnabled := default true .Page.Params.geekdocNav }} {{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9e7a5b8..94172f6 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,7 +3,7 @@

{{ partial "utils/title" . }}

{{ partial "utils/content" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 9e7a5b8..94172f6 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,7 @@

{{ partial "utils/title" . }}

{{ partial "utils/content" . }} diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html index 99dbffa..2a115e5 100644 --- a/layouts/partials/foot.html +++ b/layouts/partials/foot.html @@ -1,4 +1,4 @@ -{{ if default true .Site.Params.GeekdocSearch }} +{{ if default true .Site.Params.geekdocSearch }} {{- $searchConfigFile := printf "search/%s.config.json" .Language.Lang -}} {{- $searchConfig := resources.Get "search/config.json" | resources.ExecuteAsTemplate $searchConfigFile . | resources.Minify -}} diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index 8d0a6d4..537c2ff 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -1,4 +1,4 @@ -{{- if default true .Site.Params.GeekdocDarkModeToggle }} +{{- if default true .Site.Params.geekdocDarkModeToggle }} {{- end }} @@ -66,7 +66,7 @@ {{ printf `` .Permalink .Rel .MediaType.Type | safeHTML }} {{- end }} -{{- if (default false $.Site.Params.GeekdocOverwriteHTMLBase) }} +{{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }} {{- end }} diff --git a/layouts/partials/menu-bundle.html b/layouts/partials/menu-bundle.html index 32d4e5f..bb32387 100644 --- a/layouts/partials/menu-bundle.html +++ b/layouts/partials/menu-bundle.html @@ -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 }} diff --git a/layouts/partials/menu-filetree.html b/layouts/partials/menu-filetree.html index e236392..e51a5de 100644 --- a/layouts/partials/menu-filetree.html +++ b/layouts/partials/menu-filetree.html @@ -8,7 +8,7 @@
- {{ if (default true .Site.Params.GeekdocBackToTop) }} + {{ if (default true .Site.Params.geekdocBackToTop) }}
diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index 5e88360..022c10a 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -17,7 +17,7 @@ {{ .Root.Site.Title }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index e047e2e..70f38c3 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -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 }} diff --git a/layouts/shortcodes/toc-tree.html b/layouts/shortcodes/toc-tree.html index 74492fd..13148ba 100644 --- a/layouts/shortcodes/toc-tree.html +++ b/layouts/shortcodes/toc-tree.html @@ -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 }}
@@ -12,23 +12,25 @@