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.
```Shell
```shell
# install required packages from package.json
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:
```Shell
```shell
_includes/
├── include-page.md
└── _index.md

View File

@ -12,7 +12,7 @@ The theme supports multiple authors. The required information for each author ne
<!--more-->
```Shell
```shell
data/
└── authors
├── 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:
```YAML
```yaml
name: John Doe
email: john@example.com
```
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
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:
```Plain
```plain
`some code`
```
@ -26,22 +26,22 @@ To display an inline shortcode use single quotes:
Code blocks can be uses without language specification:
````Markdown
```Plain
````markdown
```plain
some code
```
````
**Example:**
```Plain
```plain
some code
```
... or if you need language specific syntax highlighting:
````Markdown
```Shell
````markdown
```shell
# some code
echo "Hello world"
```
@ -49,7 +49,7 @@ echo "Hello world"
**Example:**
```Shell
```shell
# some code
echo "Hello World"
```
@ -61,7 +61,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
```
@ -69,7 +69,7 @@ pygmentsCodeFences=true
{{< /tab >}}
{{< tab "YAML" >}}
```YAML
```yaml
pygmentsUseClasses: true
pygmentsCodeFences: true
```
@ -80,7 +80,7 @@ pygmentsCodeFences: true
You can use it like every other shortcode:
<!-- prettier-ignore -->
```Markdown
```markdown
{{</* highlight Shell "linenos=table" */>}}
# some code
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:
```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"/>
@ -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:
```Bash
```bash
my_projcet/
├── assets
│ └── sprites

View File

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

View File

@ -21,7 +21,7 @@ Overview of all available site and page configuration options provided by the th
{{< tabs "site-config" >}}
{{< tab "TOML" >}}
```Toml
```toml
baseURL = "http://localhost"
title = "Geekblog"
theme = "hugo-geekblog"
@ -151,7 +151,7 @@ enableRobotsTXT = true
{{< /tab >}}
{{< tab "YAML" >}}
```Yaml
```yaml
---
baseURL: "http://localhost"
title: "Geekblog"
@ -266,7 +266,8 @@ params:
geekblogDarkModeDim: false
# (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.
geekblogBackToTop: true
@ -298,7 +299,7 @@ params:
{{< tabs "page-config" >}}
{{< tab "TOML" >}}
```Toml
```toml
# Title of your post. If not set, filename will be used.
title = My first post
@ -321,7 +322,7 @@ geekblogAnchor = true
{{< /tab >}}
{{< tab "YAML" >}}
```Yaml
```yaml
# Title of your post. If not set, filename will be used.
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.
```Shell
```shell
# install required packages from package.json
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.
```Shell
```shell
hugo new site demosite
```
2. Switch to the root of the new site.
```Shell
```shell
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.
```Toml
```toml
baseURL = "http://localhost"
title = "Geekblog"
theme = "hugo-geekblog"
@ -120,13 +120,13 @@ To prepare your new site environment just a few steps are required:
5. Test your site.
```Shell
```shell
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):
```Shell
```shell
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.
```Shell
```shell
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
```
@ -150,13 +150,13 @@ run the described steps as well.
Clone the Geekblog git repository.
```Shell
```shell
git clone https://github.com/thegeeklab/hugo-geekblog.git themes/hugo-geekblog
```
Build required theme assets e.g. CSS files and SVG sprites.
```Shell
```shell
npm install
npm run build
```
@ -173,7 +173,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-geekblog
BASEDIR := docs

View File

@ -18,7 +18,7 @@ If you want to customize the menus (header and footer), this can be achieved by
**Example:**
```Yaml
```yaml
---
header:
- 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 -->

View File

@ -4,7 +4,7 @@
itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}"
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>
{{ partial "head/meta" . }}
@ -28,7 +28,7 @@
<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" . }}

View File

@ -17,7 +17,7 @@
{{- end }}
{{- end }}
<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 . }}
<author>
<name>{{ .name }}</name>

View File

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

View File

@ -21,7 +21,7 @@
<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">
{{ partial "metadata.html" . }}
</div>

View File

@ -1,7 +1,7 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
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 }}
{{- if and .Permalink (not (in $seoIgnore .Kind)) }}
<url>

View File

@ -4,8 +4,8 @@
{{ hugo.Generator }}
{{- $keywords := default .Site.Params.Keywords .Keywords -}}
{{- $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors -}}
{{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.GeekblogSeoIgnore -}}
{{- $authors := default (slice .Site.Params.geekblogAuthor) .Params.authors -}}
{{- $seoIgnore := default (slice "taxonomy" "section" "term" "404") .Site.Params.geekblogSeoIgnore -}}
{{- if not (in $seoIgnore .Kind) }}
<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>
{{- end }}
<script src="{{ index (index .Site.Data.assets "main.js") "src" | relURL }}"></script>
@ -78,7 +78,7 @@
{{- end }}
{{- end }}
{{- if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }}
{{- if (default false $.Site.Params.geekblogOverwriteHTMLBase) }}
<base href="{{ .Site.BaseURL }}" />
{{- end }}

View File

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

View File

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

View File

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

View File

@ -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.GeekblogImageLazyLoading) (.Get "lazy") }}
{{- $lazyLoad := default (default true $.Site.Params.geekblogImageLazyLoading) (.Get "lazy") }}
{{- $data := newScratch }}
{{- 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 }}
<div class="gblog-toc gblog-toc__level--{{ $tocLevels }}">