chore: normalize mixed casing of code block lang and theme parameters (#401)

This commit is contained in:
Robert Kaussow 2023-06-22 10:52:32 +02:00 committed by GitHub
parent a1229b7e55
commit a57797f12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 59 additions and 58 deletions

View File

@ -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. 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 # install required packages from package.json
npm install npm install

View File

@ -91,7 +91,7 @@ In some situations, it can be helpful to include Markdown files that also contai
Resulting structure should look like this: Resulting structure should look like this:
```Shell ```shell
_includes/ _includes/
├── include-page.md ├── include-page.md
└── _index.md └── _index.md

View File

@ -12,7 +12,7 @@ The theme supports multiple authors. The required information for each author ne
<!--more--> <!--more-->
```Shell ```shell
data/ data/
└── authors └── authors
├── john-doe.yml ├── john-doe.yml
@ -22,14 +22,14 @@ data/
The name of the file will be used as the reference later, so if you prefer some kind of naming convention this need to covered by the file names. Example authors file: The name of the file will be used as the reference later, so if you prefer some kind of naming convention this need to covered by the file names. Example authors file:
```YAML ```yaml
name: John Doe name: John Doe
email: john@example.com email: john@example.com
``` ```
With the defined files, you can add as many authors as you want to the front matter of your posts: With the defined files, you can add as many authors as you want to the front matter of your posts:
```Markdown ```markdown
--- ---
title: Demo Posts title: Demo Posts
authors: authors:

View File

@ -16,7 +16,7 @@ There are several ways to add code blocks. Most of them work out of the box, onl
To display an inline shortcode use single quotes: To display an inline shortcode use single quotes:
```Plain ```plain
`some code` `some code`
``` ```
@ -26,22 +26,22 @@ To display an inline shortcode use single quotes:
Code blocks can be uses without language specification: Code blocks can be uses without language specification:
````Markdown ````markdown
```Plain ```plain
some code some code
``` ```
```` ````
**Example:** **Example:**
```Plain ```plain
some code some code
``` ```
... or if you need language specific syntax highlighting: ... or if you need language specific syntax highlighting:
````Markdown ````markdown
```Shell ```shell
# some code # some code
echo "Hello world" echo "Hello world"
``` ```
@ -49,7 +49,7 @@ echo "Hello world"
**Example:** **Example:**
```Shell ```shell
# some code # some code
echo "Hello World" echo "Hello World"
``` ```
@ -61,7 +61,7 @@ Hugo has a build-in shortcode for syntax highlighting. To work properly with thi
{{< tabs "uniqueid" >}} {{< tabs "uniqueid" >}}
{{< tab "TOML" >}} {{< tab "TOML" >}}
```TOML ```toml
pygmentsUseClasses=true pygmentsUseClasses=true
pygmentsCodeFences=true pygmentsCodeFences=true
``` ```
@ -69,7 +69,7 @@ pygmentsCodeFences=true
{{< /tab >}} {{< /tab >}}
{{< tab "YAML" >}} {{< tab "YAML" >}}
```YAML ```yaml
pygmentsUseClasses: true pygmentsUseClasses: true
pygmentsCodeFences: true pygmentsCodeFences: true
``` ```
@ -80,7 +80,7 @@ pygmentsCodeFences: true
You can use it like every other shortcode: You can use it like every other shortcode:
<!-- prettier-ignore --> <!-- prettier-ignore -->
```Markdown ```markdown
{{</* highlight Shell "linenos=table" */>}} {{</* highlight Shell "linenos=table" */>}}
# some code # some code
echo "Hello World" echo "Hello World"

View File

@ -26,7 +26,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: 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"> <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"> <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"/> <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"/>
@ -38,7 +38,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. The result should 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. The result should look like this:
```Bash ```bash
my_projcet/ my_projcet/
├── assets ├── assets
│ └── sprites │ └── sprites

View File

@ -15,7 +15,7 @@ Sticky (or pinned) posts can be used to permanently pin important posts to the t
**Example:** **Example:**
```YAML ```yaml
--- ---
title: Simple sticky posts title: Simple sticky posts
weight: 1 weight: 1

View File

@ -21,7 +21,7 @@ Overview of all available site and page configuration options provided by the th
{{< tabs "site-config" >}} {{< tabs "site-config" >}}
{{< tab "TOML" >}} {{< tab "TOML" >}}
```Toml ```toml
baseURL = "http://localhost" baseURL = "http://localhost"
title = "Geekblog" title = "Geekblog"
theme = "hugo-geekblog" theme = "hugo-geekblog"
@ -151,7 +151,7 @@ enableRobotsTXT = true
{{< /tab >}} {{< /tab >}}
{{< tab "YAML" >}} {{< tab "YAML" >}}
```Yaml ```yaml
--- ---
baseURL: "http://localhost" baseURL: "http://localhost"
title: "Geekblog" title: "Geekblog"
@ -266,9 +266,10 @@ params:
geekblogDarkModeDim: false geekblogDarkModeDim: false
# (Optional, default false) Enforce code blocks to always use the dark color theme. # (Optional, default false) Enforce code blocks to always use the dark color theme.
geekblogDarkModeCode: false geekblogDarkModeCode:
false
# (Optional, default true) Display a "Back to top" link in the site footer. # (Optional, default true) Display a "Back to top" link in the site footer.
geekblogBackToTop: true geekblogBackToTop: true
# (Optional, default ["taxonomy", "section", "term", "404"]) # (Optional, default ["taxonomy", "section", "term", "404"])
@ -298,7 +299,7 @@ params:
{{< tabs "page-config" >}} {{< tabs "page-config" >}}
{{< tab "TOML" >}} {{< tab "TOML" >}}
```Toml ```toml
# Title of your post. If not set, filename will be used. # Title of your post. If not set, filename will be used.
title = My first post title = My first post
@ -321,7 +322,7 @@ geekblogAnchor = true
{{< /tab >}} {{< /tab >}}
{{< tab "YAML" >}} {{< tab "YAML" >}}
```Yaml ```yaml
# Title of your post. If not set, filename will be used. # Title of your post. If not set, filename will be used.
title: My first post title: My first post

View File

@ -40,7 +40,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. 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 # install required packages from package.json
npm install npm install
@ -57,13 +57,13 @@ To prepare your new site environment just a few steps are required:
1. Create a new empty Hugo site. 1. Create a new empty Hugo site.
```Shell ```shell
hugo new site demosite hugo new site demosite
``` ```
2. Switch to the root of the new site. 2. Switch to the root of the new site.
```Shell ```shell
cd demosite cd demosite
``` ```
@ -71,7 +71,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](/posts/usage/configuration/) page. 4. Create the minimal required Hugo configuration `config.toml`. For all configuration options take a look at the [configuration](/posts/usage/configuration/) page.
```Toml ```toml
baseURL = "http://localhost" baseURL = "http://localhost"
title = "Geekblog" title = "Geekblog"
theme = "hugo-geekblog" theme = "hugo-geekblog"
@ -120,13 +120,13 @@ To prepare your new site environment just a few steps are required:
5. Test your site. 5. Test your site.
```Shell ```shell
hugo server -D hugo server -D
``` ```
If you want to add some demo data you could use the content from the [Hugo basic example](https://github.com/gohugoio/hugoBasicExample): If you want to add some demo data you could use the content from the [Hugo basic example](https://github.com/gohugoio/hugoBasicExample):
```Shell ```shell
curl -L https://github.com/gohugoio/hugoBasicExample/archive/master.tar.gz | tar -xz --exclude "config*" --exclude "LICENSE" --exclude "README*" --strip-components=1 curl -L https://github.com/gohugoio/hugoBasicExample/archive/master.tar.gz | tar -xz --exclude "config*" --exclude "LICENSE" --exclude "README*" --strip-components=1
``` ```
@ -134,7 +134,7 @@ To prepare your new site environment just a few steps are required:
Download and extract the latest release bundle into the theme directory. Download and extract the latest release bundle into the theme directory.
```Shell ```shell
mkdir -p themes/hugo-geekblog/ mkdir -p themes/hugo-geekblog/
curl -L https://github.com/thegeeklab/hugo-geekblog/releases/latest/download/hugo-geekblog.tar.gz | tar -xz -C themes/hugo-geekblog/ --strip-components=1 curl -L https://github.com/thegeeklab/hugo-geekblog/releases/latest/download/hugo-geekblog.tar.gz | tar -xz -C themes/hugo-geekblog/ --strip-components=1
``` ```
@ -150,13 +150,13 @@ run the described steps as well.
Clone the Geekblog git repository. Clone the Geekblog git repository.
```Shell ```shell
git clone https://github.com/thegeeklab/hugo-geekblog.git themes/hugo-geekblog git clone https://github.com/thegeeklab/hugo-geekblog.git themes/hugo-geekblog
``` ```
Build required theme assets e.g. CSS files and SVG sprites. Build required theme assets e.g. CSS files and SVG sprites.
```Shell ```shell
npm install npm install
npm run build npm run build
``` ```
@ -173,7 +173,7 @@ Here are some possible solutions:
Add a Makefile to your repository to bundle the required steps. Add a Makefile to your repository to bundle the required steps.
```Makefile ```makefile
THEME_VERSION := v0.8.2 THEME_VERSION := v0.8.2
THEME := hugo-geekblog THEME := hugo-geekblog
BASEDIR := docs BASEDIR := docs

View File

@ -18,7 +18,7 @@ If you want to customize the menus (header and footer), this can be achieved by
**Example:** **Example:**
```Yaml ```yaml
--- ---
header: header:
- name: Github Profile - name: Github Profile

View File

@ -1,4 +1,4 @@
{{- $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) -}} {{- $showAnchor := (and (default true .Page.Params.geekblogAnchor) (default true .Page.Site.Params.geekblogAnchor)) -}}
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->

View File

@ -4,7 +4,7 @@
itemtype="http://schema.org/WebPage" itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}" lang="{{ .Site.Language.Lang }}"
class="color-toggle-hidden" class="color-toggle-hidden"
{{ if default false .Site.Params.GeekblogDarkModeCode }}code-theme="dark"{{ end }} {{ if default false .Site.Params.geekblogDarkModeCode }}code-theme="dark"{{ end }}
> >
<head> <head>
{{ partial "head/meta" . }} {{ partial "head/meta" . }}
@ -28,7 +28,7 @@
<div <div
class="wrapper {{ if default false .Site.Params.GeekblogDarkModeDim }}dark-mode-dim{{ end }}" class="wrapper {{ if default false .Site.Params.geekblogDarkModeDim }}dark-mode-dim{{ end }}"
> >
{{ partial "site-header" . }} {{ partial "site-header" . }}

View File

@ -17,7 +17,7 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
<updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{- with .Site.Params.GeekblogAuthor -}} {{- with .Site.Params.geekblogAuthor -}}
{{- with index $.Site.Data.authors . }} {{- with index $.Site.Data.authors . }}
<author> <author>
<name>{{ .name }}</name> <name>{{ .name }}</name>

View File

@ -12,7 +12,7 @@
{{- with .OutputFormats.Get "json" }} {{- with .OutputFormats.Get "json" }}
"feed_url" : "{{ .Permalink }}", "feed_url" : "{{ .Permalink }}",
{{- end }} {{- end }}
{{- with .Site.Params.GeekblogAuthor -}} {{- with .Site.Params.geekblogAuthor -}}
{{ with index $.Site.Data.authors . }} {{ with index $.Site.Data.authors . }}
"authors" : [ "authors" : [
{ {

View File

@ -21,7 +21,7 @@
<h1 class="gblog-post__title">{{ partial "utils/title" . }}</h1> <h1 class="gblog-post__title">{{ partial "utils/title" . }}</h1>
{{ if or (eq .Type (default "posts" .Site.Params.GeekblogContentSection)) (eq .Type "post") }} {{ if or (eq .Type (default "posts" .Site.Params.geekblogContentSection)) (eq .Type "post") }}
<div class="flex flex-wrap align-center gblog-post__meta gblog-post__meta--head"> <div class="flex flex-wrap align-center gblog-post__meta gblog-post__meta--head">
{{ partial "metadata.html" . }} {{ partial "metadata.html" . }}
</div> </div>

View File

@ -1,7 +1,7 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} {{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml"> xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.GeekblogSeoIgnore -}} {{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.geekblogSeoIgnore -}}
{{- range .Data.Pages }} {{- range .Data.Pages }}
{{- if and .Permalink (not (in $seoIgnore .Kind)) }} {{- if and .Permalink (not (in $seoIgnore .Kind)) }}
<url> <url>

View File

@ -4,8 +4,8 @@
{{ hugo.Generator }} {{ hugo.Generator }}
{{- $keywords := default .Site.Params.Keywords .Keywords -}} {{- $keywords := default .Site.Params.Keywords .Keywords -}}
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}} {{- $authors := default (slice .Site.Params.geekblogAuthor) .Params.authors -}}
{{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.GeekblogSeoIgnore -}} {{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.geekblogSeoIgnore -}}
{{- if not (in $seoIgnore .Kind) }} {{- if not (in $seoIgnore .Kind) }}
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />

View File

@ -1,4 +1,4 @@
{{- if default true .Site.Params.GeekblogDarkModeToggle }} {{- if default true .Site.Params.geekblogDarkModeToggle }}
<script src="{{ index (index .Site.Data.assets "colortheme.js") "src" | relURL }}"></script> <script src="{{ index (index .Site.Data.assets "colortheme.js") "src" | relURL }}"></script>
{{- end }} {{- end }}
<script src="{{ index (index .Site.Data.assets "main.js") "src" | relURL }}"></script> <script src="{{ index (index .Site.Data.assets "main.js") "src" | relURL }}"></script>
@ -78,7 +78,7 @@
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }} {{- if (default false $.Site.Params.geekblogOverwriteHTMLBase) }}
<base href="{{ .Site.BaseURL }}" /> <base href="{{ .Site.BaseURL }}" />
{{- end }} {{- end }}

View File

@ -3,7 +3,7 @@
{ {
"@context": "http://schema.org", "@context": "http://schema.org",
"@type": "WebSite", "@type": "WebSite",
{{ with .Site.Params.GeekblogAuthor -}} {{ with .Site.Params.geekblogAuthor -}}
{{ with index $.Site.Data.authors . }}"author": "{{ .name }}",{{ end }} {{ with index $.Site.Data.authors . }}"author": "{{ .name }}",{{ end }}
{{- end }} {{- end }}
"name": {{ .Site.Title }}, "name": {{ .Site.Title }},
@ -14,14 +14,14 @@
{{- with partial "utils/featured" . }} {{- with partial "utils/featured" . }}
"thumbnailUrl": {{ . }}, "thumbnailUrl": {{ . }},
{{- end }} {{- end }}
{{- with .Site.Params.GeekblogContentLicense }} {{- with .Site.Params.geekblogContentLicense }}
"license": "{{ .name }}", "license": "{{ .name }}",
{{- end }} {{- end }}
"inLanguage": {{ .Lang }} "inLanguage": {{ .Lang }}
} }
</script> </script>
{{- else if .IsPage }} {{- else if .IsPage }}
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}} {{- $authors := default (slice .Site.Params.geekblogAuthor) .Params.authors -}}
{{- $ac := 0 -}} {{- $ac := 0 -}}
{{- $ac_max := default 0 (len $authors) -}} {{- $ac_max := default 0 (len $authors) -}}
@ -43,7 +43,7 @@
"thumbnailUrl": {{ . }}, "thumbnailUrl": {{ . }},
{{- end }} {{- end }}
"wordCount" : "{{ .WordCount }}", "wordCount" : "{{ .WordCount }}",
{{- with .Site.Params.GeekblogContentLicense }} {{- with .Site.Params.geekblogContentLicense }}
"license": "{{ .name }}", "license": "{{ .name }}",
{{- end }} {{- end }}
"inLanguage": {{ .Lang }}, "inLanguage": {{ .Lang }},

View File

@ -11,12 +11,12 @@
{{ if .Site.Data.menu.extra.footer }} {{ if .Site.Data.menu.extra.footer }}
{{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.footer "target" "footer") }} {{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.footer "target" "footer") }}
{{ end }} {{ end }}
{{ with .Site.Params.GeekblogLegalNotice }} {{ with .Site.Params.geekblogLegalNotice }}
<span class="gblog-footer__item gblog-footer__item--row"> <span class="gblog-footer__item gblog-footer__item--row">
<a href="{{ . | relURL }}" class="gblog-footer__link">Legal Notice</a> <a href="{{ . | relURL }}" class="gblog-footer__link">Legal Notice</a>
</span> </span>
{{ end }} {{ end }}
{{ with .Site.Params.GeekblogPrivacyPolicy }} {{ with .Site.Params.geekblogPrivacyPolicy }}
<span class="gblog-footer__item gblog-footer__item--row"> <span class="gblog-footer__item gblog-footer__item--row">
<a href="{{ . | relURL }}" class="gblog-footer__link">Privacy Policy</a> <a href="{{ . | relURL }}" class="gblog-footer__link">Privacy Policy</a>
</span> </span>
@ -28,14 +28,14 @@
<svg class="gblog-icon gblog_heart"><use xlink:href="#gblog_heart"></use></svg> <svg class="gblog-icon gblog_heart"><use xlink:href="#gblog_heart"></use></svg>
</span> </span>
</section> </section>
{{ with .Site.Params.GeekblogHostedOn }} {{ with .Site.Params.geekblogHostedOn }}
<section class="flex flex-wrap align-center"> <section class="flex flex-wrap align-center">
<span class="gblog-footer__item"> <span class="gblog-footer__item">
Hosted on <a href="{{ .link }}" class="gblog-footer__link">{{ .name }}</a> Hosted on <a href="{{ .link }}" class="gblog-footer__link">{{ .name }}</a>
</span> </span>
</section> </section>
{{ end }} {{ end }}
{{ with .Site.Params.GeekblogContentLicense }} {{ with .Site.Params.geekblogContentLicense }}
<section class="flex flex-wrap align-center"> <section class="flex flex-wrap align-center">
<span class="gblog-footer__item"> <span class="gblog-footer__item">
Content licensed under Content licensed under
@ -44,7 +44,7 @@
</section> </section>
{{ end }} {{ end }}
</div> </div>
{{ if (default true .Site.Params.GeekblogBackToTop) }} {{ if (default true .Site.Params.geekblogBackToTop) }}
<div class="flex flex-25 justify-end"> <div class="flex flex-25 justify-end">
<span class="gblog-footer__item text-right"> <span class="gblog-footer__item text-right">
<a class="gblog-footer__link fake-link" href="#" aria-label="Back to top"> <a class="gblog-footer__link fake-link" href="#" aria-label="Back to top">

View File

@ -45,7 +45,7 @@
</div> </div>
<ul class="gblog-nav__list container flex flex-wrap justify-center menu-content"> <ul class="gblog-nav__list container flex flex-wrap justify-center menu-content">
{{ $currentPage := .RelPermalink }} {{ $currentPage := .RelPermalink }}
{{ if default true .Site.Params.GeekblogTagsToMenu }} {{ if default true .Site.Params.geekblogTagsToMenu }}
{{ range $name, $taxonomy := .Site.Taxonomies.tags }} {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }} {{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li> <li>

View File

@ -1,7 +1,7 @@
{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} {{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }}
{{- $customAlt := .Get "alt" }} {{- $customAlt := .Get "alt" }}
{{- $customSize := .Get "size" | lower }} {{- $customSize := .Get "size" | lower }}
{{- $lazyLoad := default (default true $.Site.Params.GeekblogImageLazyLoading) (.Get "lazy") }} {{- $lazyLoad := default (default true $.Site.Params.geekblogImageLazyLoading) (.Get "lazy") }}
{{- $data := newScratch }} {{- $data := newScratch }}
{{- with $source }} {{- with $source }}

View File

@ -1,4 +1,4 @@
{{ $tocLevels := default (default 6 .Site.Params.GeekblogToC) .Page.Params.GeekblogToC }} {{ $tocLevels := default (default 6 .Site.Params.geekblogToC) .Page.Params.geekblogToC }}
{{ if and $tocLevels .Page.TableOfContents }} {{ if and $tocLevels .Page.TableOfContents }}
<div class="gblog-toc gblog-toc__level--{{ $tocLevels }}"> <div class="gblog-toc gblog-toc__level--{{ $tocLevels }}">