diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md deleted file mode 100755 index b79faa8..0000000 --- a/.chglog/CHANGELOG.tpl.md +++ /dev/null @@ -1,23 +0,0 @@ -# Changelog - -{{ range .Versions -}} -## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) - -{{ range .CommitGroups -}} -### {{ .Title }} - -{{ range .Commits -}} -- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ (regexReplaceAll "(.*)/issues/(.*)" (regexReplaceAll "(Co-\\w*-by.*)" .Subject "") "${1}/pull/${2}") | trim }} -{{ end }} -{{- end -}} - -{{- if .NoteGroups -}} -{{ range .NoteGroups -}} -### {{ .Title }} - -{{ range .Notes }} -{{ .Body }} -{{ end }} -{{ end -}} -{{ end -}} -{{ end -}} diff --git a/.chglog/config.yml b/.chglog/config.yml deleted file mode 100755 index de38198..0000000 --- a/.chglog/config.yml +++ /dev/null @@ -1,25 +0,0 @@ -style: github -template: CHANGELOG.tpl.md -info: - title: CHANGELOG - repository_url: https://github.com/thegeeklab/hugo-geekdoc -options: - commit_groups: - title_maps: - feat: Features - fix: Bug Fixes - perf: Performance Improvements - refactor: Code Refactoring - chore: Others - test: Testing - ci: CI Pipeline - docs: Documentation - header: - pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$" - pattern_maps: - - Type - - Scope - - Subject - notes: - keywords: - - BREAKING CHANGE diff --git a/.eslintrc.json b/.eslintrc.json index 1cfcc37..e946021 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,22 +1,13 @@ { "env": { "browser": true, - "es6": true, - "amd": true + "es2017": true }, "extends": ["plugin:prettier/recommended"], "parser": "@babel/eslint-parser", "parserOptions": { "sourceType": "module", - "requireConfigFile": false, - "allowImportExportEverywhere": true + "requireConfigFile": false }, - "plugins": ["prettier"], - "rules": { - "require-await": "warn" - }, - "globals": { - "require": false, - "requirejs": false - } + "plugins": ["prettier"] } diff --git a/.gitsv/config.yml b/.gitsv/config.yml new file mode 100644 index 0000000..acaf506 --- /dev/null +++ b/.gitsv/config.yml @@ -0,0 +1,47 @@ +--- +version: "1.1" + +versioning: + update-major: [] + update-minor: [feat] + update-patch: [fix, perf, refactor, chore, test, ci, docs] + +tag: + pattern: "v%d.%d.%d" + +release-notes: + sections: + - name: Features + commit-types: [feat] + section-type: commits + - name: Bug Fixes + commit-types: [fix] + section-type: commits + - name: Performance Improvements + commit-types: [perf] + section-type: commits + - name: Code Refactoring + commit-types: [refactor] + section-type: commits + - name: Others + commit-types: [chore] + section-type: commits + - name: Testing + commit-types: [test] + section-type: commits + - name: CI Pipeline + commit-types: [ci] + section-type: commits + - name: Documentation + commit-types: [docs] + section-type: commits + - name: BREAKING CHANGES + section-type: breaking-changes + +commit-message: + footer: + issue: + key: issue + add-value-prefix: "#" + issue: + regex: "#?[0-9]+" diff --git a/.htmlvalidate.json b/.htmlvalidate.json new file mode 100644 index 0000000..55642f7 --- /dev/null +++ b/.htmlvalidate.json @@ -0,0 +1,8 @@ +{ + "extends": ["html-validate:standard"], + "rules": { + "element-required-content": "off", + "element-permitted-content": "off", + "no-raw-characters": "off" + } +} diff --git a/.lighthouserc.yml b/.lighthouserc.yml index 8076332..978d57e 100644 --- a/.lighthouserc.yml +++ b/.lighthouserc.yml @@ -9,8 +9,18 @@ ci: - http://localhost/usage/getting-started/ settings: chromeFlags: "--no-sandbox" - onlyCategories: ['performance', 'accessibility', 'best-practices', 'seo'] - skipAudits: ["color-contrast", "uses-long-cache-ttl", "csp-xss", "bf-cache", "is-crawlable", "image-size-responsive"] + onlyCategories: ["performance", "accessibility", "best-practices", "seo"] + skipAudits: + [ + "color-contrast", + "uses-long-cache-ttl", + "csp-xss", + "bf-cache", + "is-crawlable", + "image-size-responsive", + "render-blocking-resources", + "largest-contentful-paint" + ] assert: preset: "lighthouse:no-pwa" assertions: @@ -21,6 +31,10 @@ ci: bf-cache: off is-crawlable: off image-size-responsive: off + render-blocking-resources: off + largest-contentful-paint: off + total-byte-weight: warn + identical-links-same-purpose: warn tap-targets: warn unsized-images: warn # FIXME: https://github.com/GoogleChrome/lighthouse/issues/11460 diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 0000000..bbe71df --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,3 @@ +https://github.com/thegeeklab/.+/edit/main/.* +https://unsplash.com.* +https://www.color-hex.com.* diff --git a/.markdownlint.yml b/.markdownlint.yml index 1a62b25..b413a35 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -5,3 +5,5 @@ MD041: False MD042: False MD004: style: dash +MD010: + code_blocks: False diff --git a/.tarignore b/.tarignore index a3cc03c..8a582b0 100644 --- a/.tarignore +++ b/.tarignore @@ -9,8 +9,8 @@ .jsbeautify* .prettier* .eslintrc* -.chglog -.vnuignore +.htmlvalidate* +.lycheeignore* example* webpack* svgsprite* diff --git a/.vnuignore b/.vnuignore deleted file mode 100644 index 2727bb9..0000000 --- a/.vnuignore +++ /dev/null @@ -1,2 +0,0 @@ -.*border-content.* -.*Duplicate ID.* diff --git a/.woodpecker/build-package.yml b/.woodpecker/build-package.yml index 826ddd1..eed0755 100644 --- a/.woodpecker/build-package.yml +++ b/.woodpecker/build-package.yml @@ -6,43 +6,35 @@ when: - ${CI_REPO_DEFAULT_BRANCH} steps: - assets: + - name: assets image: docker.io/library/node:lts commands: - - git fetch -tq - - npm install > /dev/null + - npm install --quiet --no-progress - npm run build - cat VERSION environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - package: + - name: package image: docker.io/library/node:lts commands: - npm run pack environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - checksum: + - name: checksum image: quay.io/thegeeklab/alpine-tools commands: - cd dist/ && sha256sum * > ../sha256sum.txt - changelog-generate: - image: quay.io/thegeeklab/git-chglog + - name: changelog + image: quay.io/thegeeklab/git-sv commands: - - git fetch -tq - - git-chglog --no-color --no-emoji -o CHANGELOG.md ${CI_COMMIT_TAG:---next-tag unreleased unreleased} + - git sv current-version + - git sv release-notes -t ${CI_COMMIT_TAG:-next} -o CHANGELOG.md + - cat CHANGELOG.md - changelog-format: - image: quay.io/thegeeklab/alpine-tools - commands: - - prettier CHANGELOG.md - - prettier -w CHANGELOG.md - - publish-github: + - name: publish-github image: docker.io/plugins/github-release settings: api_key: diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml index 6f61e67..cec3765 100644 --- a/.woodpecker/docs.yml +++ b/.woodpecker/docs.yml @@ -6,23 +6,22 @@ when: - ${CI_REPO_DEFAULT_BRANCH} steps: - markdownlint: + - name: markdownlint image: quay.io/thegeeklab/markdownlint-cli commands: - markdownlint 'exampleSite/content/**/*.md' 'README.md' 'CONTRIBUTING.md' - spellcheck: + - name: spellcheck image: quay.io/thegeeklab/alpine-tools commands: - spellchecker --files 'exampleSite/content/**/*.md' 'README.md' -d .dictionary -p spell indefinite-article syntax-urls frontmatter --frontmatter-keys title environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - assets: + - name: assets image: docker.io/library/node:lts commands: - - npm install > /dev/null + - npm install --quiet --no-progress - npm run svg-sprite-list - mkdir -p exampleSite/themes/${CI_REPO_NAME} - curl -sSL https://github.com/${CI_REPO}/releases/latest/download/${CI_REPO_NAME}.tar.gz | tar -xz -C exampleSite/themes/${CI_REPO_NAME}/ --strip-components=1 @@ -32,40 +31,39 @@ steps: branch: - ${CI_REPO_DEFAULT_BRANCH} - assets-main: + - name: assets-main image: docker.io/library/node:lts commands: - - npm install > /dev/null + - npm install --quiet --no-progress - npm run build - npm run svg-sprite-list - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/${CI_REPO_NAME} environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error when: - event: [pull_request] - build: - image: quay.io/thegeeklab/hugo:0.115.2 + - name: build + image: quay.io/thegeeklab/hugo:0.124.1 commands: - hugo --panicOnWarning -s exampleSite/ - beautify: + - name: beautify image: quay.io/thegeeklab/alpine-tools commands: - html-beautify -r -f 'exampleSite/public/**/*.html' environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - publish: + - name: publish image: quay.io/thegeeklab/wp-s3-action settings: access_key: from_secret: s3_access_key bucket: geekdocs-root delete: true - endpoint: https://sp.rknet.org + endpoint: + from_secret: s3_endpoint path_style: true secret_key: from_secret: s3_secret_access_key @@ -76,6 +74,7 @@ steps: - event: [push, manual] branch: - ${CI_REPO_DEFAULT_BRANCH} + status: [success, failure] depends_on: - build-package diff --git a/.woodpecker/notify.yml b/.woodpecker/notify.yml index a851904..9957125 100644 --- a/.woodpecker/notify.yml +++ b/.woodpecker/notify.yml @@ -8,7 +8,7 @@ when: runs_on: [success, failure] steps: - matrix: + - name: matrix image: quay.io/thegeeklab/wp-matrix settings: homeserver: diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 29e6097..19afeee 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -6,49 +6,47 @@ when: - ${CI_REPO_DEFAULT_BRANCH} steps: - eslint: + - name: eslint image: docker.io/library/node:lts commands: - - npm install > /dev/null - - npm run lint + - npm install --quiet --no-progress + - npm run lint:js environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - assets: + - name: assets image: docker.io/library/node:lts commands: - - npm install > /dev/null + - npm install --quiet --no-progress - npm run build environment: FORCE_COLOR: "true" - NPM_CONFIG_LOGLEVEL: error - testbuild: - image: quay.io/thegeeklab/hugo:0.115.2 + - name: testbuild + image: quay.io/thegeeklab/hugo:0.124.1 commands: - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/${CI_REPO_NAME} - hugo --panicOnWarning -s exampleSite/ -b http://localhost:8000/ - html-validation: - image: quay.io/thegeeklab/vnu + - name: html-validation + image: docker.io/library/node:lts group: test commands: - - vnu --skip-non-html --also-check-css --errors-only --filterfile .vnuignore exampleSite/public - - link-validation: - image: quay.io/thegeeklab/link-validator - group: test - commands: - - link-validator --color=always --rate-limit 10 --timeout 60 -e https://github.com/thegeeklab/${CI_REPO_NAME}/edit/main/.* -e https://unsplash.com.* + - npm install --quiet --no-progress + - npm run lint:html environment: - LINK_VALIDATOR_BASE_DIR: exampleSite/public - LINK_VALIDATOR_RETRIES: "3" + FORCE_COLOR: "true" - page-validation: - image: quay.io/thegeeklab/lhci:0.12 + - name: link-validation + image: docker.io/lycheeverse/lychee + group: test + commands: + - lychee --no-progress --format detailed exampleSite/content/ README.md + + - name: page-validation + image: quay.io/thegeeklab/lhci:0.13 group: test commands: - lhci autorun environment: - LHCI_SERVER_URL: https://drone-artifact.rknet.org/${CI_REPO_NAME}/ + LHCI_SERVER_URL: https://ci-artifact.rknet.org/${CI_REPO_NAME}/ diff --git a/exampleSite/content/en/shortcodes/avatar/_index.md b/exampleSite/content/en/shortcodes/avatar/_index.md new file mode 100644 index 0000000..6d9a3fc --- /dev/null +++ b/exampleSite/content/en/shortcodes/avatar/_index.md @@ -0,0 +1,46 @@ +--- +title: Avatar +resources: + - name: avatar + src: "avatar.jpg" + title: "Avatar" +--- + +The avatar shortcode is another custom image shortcode. + + + +## Usage + +Define a resource in the page front matter. + + + +```md +--- +resources: + - name: avatar + src: "images/avatar.jpg" + title: "Avatar" +--- + +{{}} +``` + + + +## Attributes + + + +{{< propertylist name=shortcode-avatar sort=name order=asc >}} + + + +## Example + + + +{{< avatar name=avatar size="small" >}} + + diff --git a/exampleSite/content/en/shortcodes/avatar/avatar.jpg b/exampleSite/content/en/shortcodes/avatar/avatar.jpg new file mode 100644 index 0000000..d0fc747 Binary files /dev/null and b/exampleSite/content/en/shortcodes/avatar/avatar.jpg differ diff --git a/exampleSite/content/en/shortcodes/buttons.md b/exampleSite/content/en/shortcodes/buttons.md index 009d3f0..87ee07f 100644 --- a/exampleSite/content/en/shortcodes/buttons.md +++ b/exampleSite/content/en/shortcodes/buttons.md @@ -4,11 +4,20 @@ title: Buttons Buttons are styled links that can lead to local page or external link. - +## Usage + + ```tpl {{}}Get Home{{}} {{}}Contribute{{}} ``` + +### Attributes + + + +{{< propertylist name=shortcode-buttons sort=name order=asc >}} + ## Example diff --git a/exampleSite/content/en/shortcodes/columns.md b/exampleSite/content/en/shortcodes/columns.md index 8302266..9f3053c 100644 --- a/exampleSite/content/en/shortcodes/columns.md +++ b/exampleSite/content/en/shortcodes/columns.md @@ -4,12 +4,6 @@ title: Columns The Columns shortcode can be used to organize content side-by-side (horizontally) for better readability. -## Attributes - -| Name | Description | default | -| --------------- | ------------------------------------------------ | ------- | -| size (optional) | size of the first column (small\|regular\|large) | regular | - ## Usage ```html @@ -29,11 +23,19 @@ Dolor sit, sumo unique argument um no ... {{}} ``` +### Attributes + + + +{{< propertylist name=shortcode-columns sort=name order=asc >}} + + + ## Example {{< columns >}} -## Left +### Left Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts @@ -42,14 +44,14 @@ copious quo ad. Stet probates in duo. <---> -## Mid Content +### Mid Content Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. <---> -## Right Content +### Right Content Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts diff --git a/exampleSite/content/en/shortcodes/expand.md b/exampleSite/content/en/shortcodes/expand.md index 9dcd2fc..7330680 100644 --- a/exampleSite/content/en/shortcodes/expand.md +++ b/exampleSite/content/en/shortcodes/expand.md @@ -4,40 +4,38 @@ title: Expand Expand shortcode can help to decrease clutter on screen by hiding part of text. Expand content by clicking on it. -## Example +## Usage -### Default - - ```tpl {{}} -## Markdown content +### Markdown content Dolor sit, sumo unique ... {{}} ``` - + +It is also possible to use a custom label and symbol. + + + +```tpl +{{}} +### More markdown +Dolor sit, sumo unique ... +{{}} +``` + +## Example {{< expand >}} -## Markdown content +### Markdown content Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. {{< /expand >}} -### With Custom Label - - -```tpl -{{}} -## Markdown content -Dolor sit, sumo unique ... -{{}} -``` - - {{< expand "Custom Label" "..." >}} -## More markdown +### More markdown Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts diff --git a/exampleSite/content/en/shortcodes/hints.md b/exampleSite/content/en/shortcodes/hints.md index 51959a8..a4d728a 100644 --- a/exampleSite/content/en/shortcodes/hints.md +++ b/exampleSite/content/en/shortcodes/hints.md @@ -4,14 +4,6 @@ title: Hints Hint shortcode can be used as hint/alerts/notification block. -## Attributes - -| Name | Description | default | -| ---------------- | -------------------------------------------------------------------------------- | --------- | -| type | hint type | note | -| icon (optional) | custom icon to use,need to be an icon from an [SVG sprite](/features/icon-sets/) | undefined | -| title (optional) | hint title | undefined | - ## Usage @@ -24,6 +16,14 @@ Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclima ``` +### Attributes + + + +{{< propertylist name=shortcode-hints sort=name order=asc >}} + + + ## Example {{< hint type=note >}} diff --git a/exampleSite/content/en/shortcodes/icons.md b/exampleSite/content/en/shortcodes/icons.md index 95c16d6..dfa3561 100644 --- a/exampleSite/content/en/shortcodes/icons.md +++ b/exampleSite/content/en/shortcodes/icons.md @@ -4,15 +4,17 @@ title: Icons Simple shortcode to include icons from SVG sprites outside of menus. +## Usage + ```tpl {{}} ``` -## Usage +## Example -| Result | Usage | +| Output | Code | | -------------------------- | -------------------------------- | | {{< icon "thumbs-up" >}} | `{{}}` | | {{< icon "thumbs-down" >}} | `{{}}` | diff --git a/exampleSite/content/en/shortcodes/images/_index.md b/exampleSite/content/en/shortcodes/images/_index.md index 951c686..01ba84e 100644 --- a/exampleSite/content/en/shortcodes/images/_index.md +++ b/exampleSite/content/en/shortcodes/images/_index.md @@ -46,15 +46,6 @@ resources: If you need more flexibility for your embedded images, you could use the `img` shortcode. It is using Hugo's [page resources](https://gohugo.io/content-management/page-resources/) and supports lazy loading of your images. -## Attributes - -| Name | Description | default | -| ---- | ------------------------------------------------------------ | ----------------- | -| name | name of the image resource defined in your front matter | empty | -| alt | description for displayed image | resource `.Title` | -| size | Thumbnail size (origin\|profile\|tiny\|small\|medium\|large) | empty | -| lazy | enable or disable image lazy loading | true | - ## Usage Define your resources in the page front matter, custom parameter `params.credits` is optional. @@ -74,6 +65,14 @@ resources: {{}} ``` +### Attributes + + + +{{< propertylist name=shortcode-images sort=name order=asc >}} + + + ## Example diff --git a/exampleSite/content/en/shortcodes/includes.md b/exampleSite/content/en/shortcodes/includes.md index 25ad079..de94631 100644 --- a/exampleSite/content/en/shortcodes/includes.md +++ b/exampleSite/content/en/shortcodes/includes.md @@ -2,28 +2,27 @@ title: Includes --- -{{< toc >}} - Include shortcode can include files of different types. By specifying a language, the included file will have syntax highlighting. +## Usage + ```tpl {{}} ``` -Attributes: +### Attributes -| Name | Description | Default | -| -------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | -| file | path to the included file relative to the Hugo root | undefined | -| language | language for [syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages) | undefined | -| type | special include type (`html,page`) | undefined (rendered as markdown) | -| options | highlighting [options](https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode) | `linenos=table` | + + +{{< propertylist name=shortcode-includes sort=name order=asc >}} + + -## Examples +## Example -### Markdown file (default) +### Example 1: Markdown file (default) If no other options are specified, files will be rendered as Markdown using the `RenderString` [function](https://gohugo.io/functions/renderstring/). @@ -43,7 +42,7 @@ If you include markdown files that should not get a menu entry, place them outsi -### Language files +### Example 2: Language files This method can be used to include source code files and keep them automatically up to date. @@ -60,9 +59,7 @@ Result: -### Special include types - -#### HTML +### Example 3: HTML HTML content will be filtered by the `safeHTML` filter and added to the rendered page output. @@ -73,9 +70,9 @@ HTML content will be filtered by the `safeHTML` filter and added to the rendered {{< include file="/static/_includes/example.html.part" type="html" >}} -#### Pages +### Example 4: Hugo Pages -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: +In some situations, it can be helpful to include Markdown files that also contain shortcodes. While the [default method](#example-1-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. diff --git a/exampleSite/content/en/shortcodes/katex.md b/exampleSite/content/en/shortcodes/katex.md index 4306c63..d1ed300 100644 --- a/exampleSite/content/en/shortcodes/katex.md +++ b/exampleSite/content/en/shortcodes/katex.md @@ -4,7 +4,7 @@ title: KaTeX [KaTeX](https://katex.org/) shortcode let you render math typesetting in markdown document. -## Example +## Usage ```latex {{}} @@ -12,6 +12,16 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi {{}} ``` +### Attributes + + + +{{< propertylist name=shortcode-katex sort=name order=asc >}} + + + +## Example + {{< katex display >}} @@ -20,4 +30,4 @@ f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi -KaTeX can be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter (see above). +KaTeX can be used inline, for example {{< katex >}}\pi(x){{< /katex >}} or used with the `display` parameter as above. diff --git a/exampleSite/content/en/shortcodes/mermaid.md b/exampleSite/content/en/shortcodes/mermaid.md index 6a644b8..0379ba8 100644 --- a/exampleSite/content/en/shortcodes/mermaid.md +++ b/exampleSite/content/en/shortcodes/mermaid.md @@ -4,7 +4,7 @@ title: Mermaid [Mermaid](https://mermaidjs.github.io/) is library for generating SVG charts and diagrams from text. -## Example +## Usage ```tpl @@ -22,6 +22,16 @@ sequenceDiagram {{}} ``` +### Attributes + + + +{{< propertylist name=shortcode-mermaid sort=name order=asc >}} + + + +## Example + {{< mermaid class="text-center" >}} diff --git a/exampleSite/content/en/shortcodes/progress.md b/exampleSite/content/en/shortcodes/progress.md index 2a863e1..e0009cf 100644 --- a/exampleSite/content/en/shortcodes/progress.md +++ b/exampleSite/content/en/shortcodes/progress.md @@ -4,20 +4,19 @@ title: Progress A progress bar shows how far a process has progressed. -## Attributes - -| Name | Description | default | -| ---------------- | -------------------------------------------------------------------------- | --------- | -| value | progress value | 0 | -| icon (optional) | icon to use, need to be an icon from an [SVG sprite](/features/icon-sets/) | undefined | -| title (optional) | progress title | undefined | - ## Usage - + ```tpl {{}} ``` + +### Attributes + + + +{{< propertylist name=shortcode-progress sort=name order=asc >}} + ## Example diff --git a/exampleSite/content/en/shortcodes/propertylist.md b/exampleSite/content/en/shortcodes/propertylist.md index d00c13c..1718b3b 100644 --- a/exampleSite/content/en/shortcodes/propertylist.md +++ b/exampleSite/content/en/shortcodes/propertylist.md @@ -4,14 +4,6 @@ title: Properties The property list shortcode creates a custom HTML description list that can be used to display properties or variables and general dependent information. The shortcode requires a data file in `data/properties/`, e.g. `data/properties/demo.yaml`. -## Attributes - -| Name | Description | default | -| ---------------- | ------------------------------------------------------ | --------- | -| name | name of the file from the `data/properties/` directory | undefined | -| sort (optional) | field name to use for sorting | undefined | -| order (optional) | sort order, only applied if `sort` is set | `asc` | - ## Usage @@ -28,6 +20,14 @@ The supported attributes can be taken from the following example: +### Attributes + + + +{{< propertylist name=shortcode-buttons sort=name order=asc >}} + + + ## Example diff --git a/exampleSite/content/en/shortcodes/tabs.md b/exampleSite/content/en/shortcodes/tabs.md index ed3a9cc..d0e768c 100644 --- a/exampleSite/content/en/shortcodes/tabs.md +++ b/exampleSite/content/en/shortcodes/tabs.md @@ -4,6 +4,8 @@ title: Tabs Tabs let you organize content by context, for example installation instructions for each supported platform. +## Usage + ```tpl {{}} diff --git a/exampleSite/content/en/shortcodes/toc-tree.md b/exampleSite/content/en/shortcodes/toc-tree.md index 406452e..e0b4e25 100644 --- a/exampleSite/content/en/shortcodes/toc-tree.md +++ b/exampleSite/content/en/shortcodes/toc-tree.md @@ -4,12 +4,22 @@ title: ToC-Tree The `toc-tree` shortcode will generate a Table of Content from a section file tree of your content directory. The root of the resulting ToC will be the page on which you define the shortcode. +## Usage + ```tpl -{{}} +{{}} ``` +### Attributes + + + +{{< propertylist name=shortcode-toc-tree sort=name order=asc >}} + + + ## Example As said, the root will be the site on which the shortcode was used, you can see a demo including nesting in the [ToC Tree](/toc-tree/) section. diff --git a/exampleSite/content/en/shortcodes/toc.md b/exampleSite/content/en/shortcodes/toc.md index c1529a9..da8b7a3 100644 --- a/exampleSite/content/en/shortcodes/toc.md +++ b/exampleSite/content/en/shortcodes/toc.md @@ -4,21 +4,22 @@ title: ToC Simple wrapper to generate a page Table of Content from a shortcode. -**Attributes:** +## Usage -| Name | Description | Default | -| ------ | -------------------------- | ------------------------------------------------------------- | -| format | format of the returned ToC | html | - -**Usage:** - - + ```tpl {{}} ``` + +### Attributes + + + +{{< propertylist name=shortcode-toc sort=name order=asc >}} + -**Example:** +## Example {{< toc >}} diff --git a/exampleSite/content/en/usage/configuration.md b/exampleSite/content/en/usage/configuration.md index 4bfc570..ee0235e 100644 --- a/exampleSite/content/en/usage/configuration.md +++ b/exampleSite/content/en/usage/configuration.md @@ -26,7 +26,8 @@ enableRobotsTXT = true [markup] [markup.goldmark.renderer] - # Needed for mermaid shortcode + # Needed for mermaid shortcode or when nesting shortcodes (e.g. img within + # columns or tabs) unsafe = true [markup.tableOfContents] startLevel = 1 @@ -53,8 +54,7 @@ enableRobotsTXT = true # per page if enabled. Can be enabled per page via 'geekdocCollapseSection'. geekdocCollapseAllSections = true - # (Optional, default true) Show page navigation links at the bottom of each - # docs page (bundle menu only). + # (Optional, default true) Show page navigation links at the bottom of each docs page. geekdocNextPrev = false # (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page. @@ -97,7 +97,7 @@ enableRobotsTXT = true # by the 'img' shortcode. geekdocImageLazyLoading = true - # (Optional, default false) Set HTMl to .Site.BaseURL if enabled. It might be required + # (Optional, default false) Set HTMl to .Site.Home.Permalink if enabled. It might be required # if a subdirectory is used within Hugos BaseURL. # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. geekdocOverwriteHTMLBase = false @@ -151,7 +151,8 @@ enableRobotsTXT: true markup: goldmark: - # Needed for mermaid shortcode + # Needed for mermaid shortcode or when nesting shortcodes (e.g. img within + # columns or tabs) renderer: unsafe: true tableOfContents: @@ -179,8 +180,7 @@ params: # per page if enabled. Can be enabled per page via 'geekdocCollapseSection'. geekdocCollapseAllSections: true - # (Optional, default true) Show page navigation links at the bottom of each - # docs page (bundle menu only). + # (Optional, default true) Show page navigation links at the bottom of each docs page. geekdocNextPrev: false # (Optional, default true) Show a breadcrumb navigation bar at the top of each docs page. @@ -223,7 +223,7 @@ params: # by the 'img' shortcode. geekdocImageLazyLoading: true - # (Optional, default false) Set HTMl to .Site.BaseURL if enabled. It might be required + # (Optional, default false) Set HTMl to .Site.Home.Permalink if enabled. It might be required # if a subdirectory is used within Hugos BaseURL. # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. geekdocOverwriteHTMLBase: false diff --git a/exampleSite/content/en/usage/getting-started.md b/exampleSite/content/en/usage/getting-started.md index c5df602..6776339 100644 --- a/exampleSite/content/en/usage/getting-started.md +++ b/exampleSite/content/en/usage/getting-started.md @@ -44,7 +44,7 @@ To prepare your new site environment just a few steps are required: 3. Install the Geekdoc theme from a [release bundle](#option-1-download-pre-build-release-bundle) (recommended) or from [Git branch](#option-2-clone-the-github-repository). -4. Create the minimal required Hugo configuration `config.toml`. For all configuration options take a look at the [configuration](/usage/configuration/) page. +4. Create the minimal required Hugo configuration `config.toml`. For all configuration options take a look at the [configuration page](/usage/configuration/). ```toml baseURL = "http://localhost" @@ -64,7 +64,8 @@ To prepare your new site environment just a few steps are required: # Needed for mermaid shortcodes [markup] [markup.goldmark.renderer] - # Needed for mermaid shortcode + # Needed for mermaid shortcode or when nesting shortcodes (e.g. img within + # columns or tabs) unsafe = true [markup.tableOfContents] startLevel = 1 @@ -80,6 +81,8 @@ To prepare your new site environment just a few steps are required: hugo server -D ``` + The `-D` or `--buildDrafts` option is used to include content marked as draft during the build. It is used because content pages created with the `hugo new content` command have the `draft` flag set by default and this can lead to build errors in newly created projects. For projects with a production-ready content structure, this flag is not required in most cases and can be omitted. + ### Option 1: Download pre-build release bundle Download and extract the latest release bundle into the theme directory. @@ -92,7 +95,6 @@ curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/latest/download/hugo ### Option 2: Clone the GitHub repository {{< hint type=note >}} -**Info**\ Keep in mind this method is not recommended and needs some extra steps to get it working. If you want to use the Theme as submodule keep in mind that your build process need to run the described steps as well. @@ -119,12 +121,17 @@ There are several ways to deploy your site with this theme on Netlify. Regardles Here are some possible solutions: -**Use a Makefile:** +#### Use a Makefile Add a Makefile to your repository to bundle the required steps. +{{< hint type=important >}} +The `Makefile` is only an example. Depending on your project structure, `BASEDIR` or `THEMEDIR` may need to be adapted. +{{< /hint >}} + ```makefile -THEME_VERSION := v0.8.2 +# Please change the theme version to the latest release version. +THEME_VERSION := v0.44.1 THEME := hugo-geekdoc BASEDIR := docs THEMEDIR := $(BASEDIR)/themes @@ -134,20 +141,20 @@ doc: doc-assets doc-build .PHONY: doc-assets doc-assets: - mkdir -p $(THEMEDIR)/$(THEME)/ ; \ - curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1 + mkdir -p $(THEMEDIR)/$(THEME)/ ; \ + curl -sSL "https://github.com/thegeeklab/$(THEME)/releases/download/${THEME_VERSION}/$(THEME).tar.gz" | tar -xz -C $(THEMEDIR)/$(THEME)/ --strip-components=1 .PHONY: doc-build doc-build: - cd $(BASEDIR); hugo + cd $(BASEDIR); hugo .PHONY: clean clean: - rm -rf $(THEMEDIR) && \ - rm -rf $(BASEDIR)/public + rm -rf $(THEMEDIR) && \ + rm -rf $(BASEDIR)/public ``` -This Makefile can be used in your `netlify.toml`, take a look at the Netlify [example](https://docs.netlify.com/configure-builds/file-based-configuration/#sample-netlify-toml-file) for more information: +This Makefile can be used in your `netlify.toml`, take a look at the [Netlify example](https://docs.netlify.com/configure-builds/file-based-configuration/#sample-netlify-toml-file) for more information: ```toml [build] @@ -155,7 +162,7 @@ publish = "docs/public" command = "make doc" ``` -**Chain required commands:** +#### Chain required commands Chain all required commands to prepare the theme and build your site on the `command` option in your `netlify.toml` like this: @@ -168,7 +175,6 @@ command = "command1 && command 2 && command3 && hugo" ### Subdirectories {{< hint type=important >}} -**Warning**\ As deploying Hugo sites on subdirectories is not as robust as on subdomains, we do not recommend this. If you have a choice, using a domain/subdomain should always be the preferred solution! {{< /hint >}} @@ -193,7 +199,7 @@ Using `hugo --minify` without further configuration or using other minify tools After some testing we decided to not spend effort to fix this issue for now as the benefit is very low. There are some parts of the theme where spaces between HTML elements matters but were stripped by minify tools. Some of these issues are related to [gohugoio/hugo#6892](https://github.com/gohugoio/hugo/issues/6892). While recommendation like "don't depend on whitespace in your layout" sounds reasonable, it seems to be not that straight forward especially for something like embedded icons into the text flow. -If you still want to use Hugo's minify flag you should at least exclude HTML file in your site [configuration](https://gohugo.io/getting-started/configuration/#configure-minify): +If you still want to use Hugo's minify flag you should at least exclude HTML files in your site configuration as described in the [Hugo documentation](https://gohugo.io/getting-started/configuration/#configure-minify): ```toml [minify] diff --git a/exampleSite/data/properties/shortcode-avatar.yaml b/exampleSite/data/properties/shortcode-avatar.yaml new file mode 100644 index 0000000..1224783 --- /dev/null +++ b/exampleSite/data/properties/shortcode-avatar.yaml @@ -0,0 +1,18 @@ +--- +properties: + - name: name + type: string + description: Name of the image resource defined in page front matter. + required: true + - name: alt + type: string + description: Description text for the image. + required: false + - name: size + type: string + description: Thumbnail size. Supported values are `origin|tiny|small|medium|large`. + required: false + - name: anchor + type: string + description: "[Anchor](https://gohugo.io/content-management/image-processing/#anchor) to determine the placement of the crop box." + required: false diff --git a/exampleSite/data/properties/shortcode-buttons.yaml b/exampleSite/data/properties/shortcode-buttons.yaml new file mode 100644 index 0000000..71275c6 --- /dev/null +++ b/exampleSite/data/properties/shortcode-buttons.yaml @@ -0,0 +1,19 @@ +--- +properties: + - name: href + type: string + description: The URL to use as target of the button. + required: false + - name: relref + type: string + description: Executes the [relref](https://gohugo.io/functions/urls/relref/) Hugo function to resolve the relative permalink of the specified page. The result is set as the target of the button. + required: false + - name: class + type: list + description: List of space-separated CSS class names to apply. + required: false + - name: size + type: string + description: Preset of different button sizes. Supported values are `regular|large`. + required: false + devaultValue: regular diff --git a/exampleSite/data/properties/shortcode-columns.yaml b/exampleSite/data/properties/shortcode-columns.yaml new file mode 100644 index 0000000..77104b9 --- /dev/null +++ b/exampleSite/data/properties/shortcode-columns.yaml @@ -0,0 +1,7 @@ +--- +properties: + - name: size + type: string + description: Preset of different sizes for the _first_ column. Supported values are `small|regular|large`. + required: false + defaultValue: regular diff --git a/exampleSite/data/properties/shortcode-hints.yaml b/exampleSite/data/properties/shortcode-hints.yaml new file mode 100644 index 0000000..df472b4 --- /dev/null +++ b/exampleSite/data/properties/shortcode-hints.yaml @@ -0,0 +1,15 @@ +--- +properties: + - name: type + type: string + description: Type of the hint. Supported values are `note|tip|important|caution|warning`. + required: false + defaultValue: note + - name: icon + type: string + description: Icon to use. The value need to be an icon from an [SVG sprite](/features/icon-sets/). + required: false + - name: title + type: string + description: Title text of the hint. + required: false diff --git a/exampleSite/data/properties/shortcode-images.yaml b/exampleSite/data/properties/shortcode-images.yaml new file mode 100644 index 0000000..a3d3f15 --- /dev/null +++ b/exampleSite/data/properties/shortcode-images.yaml @@ -0,0 +1,19 @@ +--- +properties: + - name: name + type: string + description: Name of the image resource defined in page front matter. + required: true + - name: alt + type: string + description: Description text for the image. + required: false + - name: size + type: string + description: Thumbnail size. Supported values are `origin|tiny|small|medium|large`. + required: false + - name: lazy + type: bool + description: Enable/disable lazy loading for the image. + required: false + defaultValue: true diff --git a/exampleSite/data/properties/shortcode-includes.yaml b/exampleSite/data/properties/shortcode-includes.yaml new file mode 100644 index 0000000..d5dc58d --- /dev/null +++ b/exampleSite/data/properties/shortcode-includes.yaml @@ -0,0 +1,19 @@ +--- +properties: + - name: file + type: string + description: Path of the file (relative to the Hugo root) to include. + required: true + - name: language + type: string + description: Language for [syntax highlighting](https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages). + required: false + - name: type + type: string + description: Special include type. Supported values are `html|page`. If not set the included file is rendered as markdown. + required: false + - name: options + type: bool + description: highlighting [options](https://gohugo.io/content-management/syntax-highlighting/#highlight-shortcode). + required: false + defaultValue: linenos=table diff --git a/exampleSite/data/properties/shortcode-katex.yaml b/exampleSite/data/properties/shortcode-katex.yaml new file mode 100644 index 0000000..2dc0d89 --- /dev/null +++ b/exampleSite/data/properties/shortcode-katex.yaml @@ -0,0 +1,6 @@ +--- +properties: + - name: class + type: list + description: List of space-separated CSS class names to apply. + required: false diff --git a/exampleSite/data/properties/shortcode-mermaid.yaml b/exampleSite/data/properties/shortcode-mermaid.yaml new file mode 100644 index 0000000..2dc0d89 --- /dev/null +++ b/exampleSite/data/properties/shortcode-mermaid.yaml @@ -0,0 +1,6 @@ +--- +properties: + - name: class + type: list + description: List of space-separated CSS class names to apply. + required: false diff --git a/exampleSite/data/properties/shortcode-progress.yaml b/exampleSite/data/properties/shortcode-progress.yaml new file mode 100644 index 0000000..39d3cd0 --- /dev/null +++ b/exampleSite/data/properties/shortcode-progress.yaml @@ -0,0 +1,15 @@ +--- +properties: + - name: value + type: integer + description: Progress value. + required: false + defaultValue: 0 + - name: icon + type: string + description: Icon to use. The value need to be an icon from an [SVG sprite](/features/icon-sets/). + required: false + - name: title + type: string + description: Title text of the progress bar. + required: false diff --git a/exampleSite/data/properties/shortcode-propertylist.yaml b/exampleSite/data/properties/shortcode-propertylist.yaml new file mode 100644 index 0000000..4fe0fb2 --- /dev/null +++ b/exampleSite/data/properties/shortcode-propertylist.yaml @@ -0,0 +1,15 @@ +--- +properties: + - name: name + type: string + description: Name of the file from the `data/properties/` directory. + required: true + - name: sort + type: string + description: Field name to use for sorting. + required: false + - name: order + type: string + description: Sort order, only applied if `sort` is set. Supported values are `asc|desc`. + required: false + defaultValue: asc diff --git a/exampleSite/data/properties/shortcode-toc-tree.yaml b/exampleSite/data/properties/shortcode-toc-tree.yaml new file mode 100644 index 0000000..8122126 --- /dev/null +++ b/exampleSite/data/properties/shortcode-toc-tree.yaml @@ -0,0 +1,8 @@ +--- +properties: + - name: sortBy + type: string + description: | + Override the default sort parameter set by [`geekdocFileTreeSortBy`](/usage/configuration/#site-configuration). + required: false + defaultValue: .Site.Params.geekdocFileTreeSortBy diff --git a/exampleSite/data/properties/shortcode-toc.yaml b/exampleSite/data/properties/shortcode-toc.yaml new file mode 100644 index 0000000..d5688c5 --- /dev/null +++ b/exampleSite/data/properties/shortcode-toc.yaml @@ -0,0 +1,10 @@ +--- +properties: + - name: format + type: string + description: | + Format of the returned ToC. The `html` format creates an HTML wrapper to enable the `geekdocToC` parameter that limits + the maximum ToC level to be displayed. This variant also automatically inserts a horizontal line after the ToC. The `raw` format + returns the unformatted ToC, the parameter `geekdocToC` does not work in this mode. Supported values are `html|raw`. + required: false + defaultValue: html diff --git a/i18n/am.yaml b/i18n/am.yaml new file mode 100644 index 0000000..b9db5dc --- /dev/null +++ b/i18n/am.yaml @@ -0,0 +1,52 @@ +--- +edit_page: ገጹን ማስተካከያ + +nav_navigation: መሄጃ +nav_tags: መለያዎች +nav_more: ተጨማሪ +nav_top: ወደ ላይ ተመለስ + +form_placeholder_search: ፈልግ + +error_page_title: ጠፋብዎት? አይጨነቁ። +error_message_title: ጠፋብዎት? +error_message_code: አልተገኘም +error_message_text: > + ገጹን ማግኘት አልተቻለም፤ ነገር ግን አይጨነቁ፤ በዚህ ገጽ መመለስ ይችላሉ። + +button_toggle_dark: ብሩህ/ጨለማ መቀያየሪያ +button_nav_open: መሄጃውን ክፈት +button_nav_close: መሄጃውን ዝጋ +button_menu_open: ምርጫዎችን ክፈት +button_menu_close: ምርጫዎችን ዝጋ +button_homepage: ወደ መጀመሪያ ገጽ ተመለስ + +title_anchor_prefix: "ማያያዣ ወደ:" + +posts_read_more: ሙሉውን ያንብቡ +posts_read_time: + one: "ለማንበብ አንድ ደቂቃ" + other: "{{ . }} ደቂቃዎች ለማንበብ" +posts_update_prefix: መጨረሻ የዘመነው +posts_count: + one: "አንድ ጽሑፍ" + other: "{{ . }} ጽሑፎች" +posts_tagged_with: ከ '{{ . }}' ጋር የተዛመዱ ጽሑፎች በሙሉ + +footer_build_with: > + በ Hugo የተገነባ ከ + ጋር +footer_legal_notice: ሕጋዊ መረጃዎች +footer_privacy_policy: ስለ መረጃዎ አያያዝ ያለን አቋም +footer_content_license_prefix: > + ስለ ይዘቱ ባለመብትነት መረጃ + +language_switch_no_tranlation_prefix: "ያልተተረጐመ ገጽ:" + +propertylist_required: ግድ የሚያስፈልግ +propertylist_optional: ግድ ያልሆነ +propertylist_default: በባዶ ፈንታ + +pagination_page_prev: ያለፈው +pagination_page_next: ቀጣይ +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/i18n/fr.yaml b/i18n/fr.yaml new file mode 100644 index 0000000..bbded85 --- /dev/null +++ b/i18n/fr.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Editer la page + +nav_navigation: Navigation +nav_tags: Tags +nav_more: Plus +nav_top: Retour au haut de page + +form_placeholder_search: Chercher + +error_page_title: Perdu? Ne t'inquiète pas +error_message_title: Perdu? +error_message_code: Error 404 +error_message_text: > + On dirait que ce que vous cherchez est introuvable. Ne vous inquiétez pas, nous pouvons + vous ramèner à la page d'accueil. + +button_toggle_dark: Basculer le mode Sombre/Clair/Auto +button_nav_open: Ouvrir la navigation +button_nav_close: Fermer la navigation +button_menu_open: Ouvrir la barre de menus +button_menu_close: Fermer la barre de menus +button_homepage: retour à la page d'accueil + +title_anchor_prefix: "Ancrer à :" + +posts_read_more: Lire l'article complet +posts_read_time: + one: "Une minute pour lire" + other: "{{ . }} minutes à lire" +posts_update_prefix: Mis à jour le +posts_count: + one: "Un billet" + other: "{{ . }} billets" +posts_tagged_with: Tous les articles marqués avec '{{ . }}' + +footer_build_with: > + Construit avec Hugo et + +footer_legal_notice: Mentions légales +footer_privacy_policy: Politique de confidentialité +footer_content_license_prefix: > + Contenu sous licence + +language_switch_no_tranlation_prefix: "Page non traduite:" + +propertylist_required: requis +propertylist_optional: facultatif +propertylist_default: défaut + +pagination_page_prev: précédent +pagination_page_next: suivant +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/layouts/404.html b/layouts/404.html index f8a61bb..ee7ba2d 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -27,7 +27,7 @@
{{ i18n "error_message_title" }}
{{ i18n "error_message_code" }}
- {{ i18n "error_message_text" .Site.BaseURL | safeHTML }} + {{ i18n "error_message_text" .Site.Home.Permalink | safeHTML }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index b4c147b..29c415c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -48,9 +48,16 @@ {{ template "main" . }} + {{ $showPrevNext := (default true .Site.Params.geekdocNextPrev) }} + {{ if $showPrevNext }} + {{ end }} diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index 537c2ff..06f346d 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -67,7 +67,7 @@ {{- end }} {{- if (default false $.Site.Params.geekdocOverwriteHTMLBase) }} - + {{- end }} {{ printf "" "Made with Geekdoc theme https://github.com/thegeeklab/hugo-geekdoc" | safeHTML }} diff --git a/layouts/partials/menu-nextprev.html b/layouts/partials/menu-bundle-np.html similarity index 57% rename from layouts/partials/menu-nextprev.html rename to layouts/partials/menu-bundle-np.html index 6126f95..593b649 100644 --- a/layouts/partials/menu-nextprev.html +++ b/layouts/partials/menu-bundle-np.html @@ -6,9 +6,9 @@ {{ $current.Scratch.Set "nextPage" false }} {{ $current.Scratch.Set "prevPage" false }} -{{ template "menu_nextprev" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }} +{{ template "menu-bundle-np" dict "sect" $.Site.Data.menu.main.main "current" $current "site" $site }} -{{ define "menu_nextprev" }} +{{ define "menu-bundle-np" }} {{ $current := .current }} {{ $site := .site }} @@ -44,35 +44,32 @@ {{ $sub := default false .sub }} {{ if $sub }} - {{ template "menu_nextprev" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }} + {{ template "menu-bundle-np" dict "sect" $sub "current" ($current.Scratch.Get "current") "site" ($current.Scratch.Get "site") }} {{ end }} {{ end }} {{ end }} -{{ $showPrevNext := (and (default true .Site.Params.geekdocNextPrev) .Site.Params.geekdocMenuBundle) }} -{{ if $showPrevNext }} - - {{ with ($current.Scratch.Get "prevPage") }} - - gdoc_arrow_left_alt - {{ .name }} - - {{ end }} - - - {{ with ($current.Scratch.Get "nextPage") }} - - {{ .name }} - gdoc_arrow_right_alt - - {{ end }} - -{{ end }} + + {{ with ($current.Scratch.Get "prevPage") }} + + gdoc_arrow_left_alt + {{ .name }} + + {{ end }} + + + {{ with ($current.Scratch.Get "nextPage") }} + + {{ .name }} + gdoc_arrow_right_alt + + {{ end }} + diff --git a/layouts/partials/menu-bundle.html b/layouts/partials/menu-bundle.html index 8fc9fa9..d9dcfbb 100644 --- a/layouts/partials/menu-bundle.html +++ b/layouts/partials/menu-bundle.html @@ -52,7 +52,7 @@ {{ end }} diff --git a/layouts/partials/menu-filetree-np.html b/layouts/partials/menu-filetree-np.html new file mode 100644 index 0000000..8c50969 --- /dev/null +++ b/layouts/partials/menu-filetree-np.html @@ -0,0 +1,107 @@ +{{ $current := . }} +{{ $site := .Site }} +{{ $current.Scratch.Set "prev" false }} +{{ $current.Scratch.Set "getNext" false }} + +{{ $current.Scratch.Set "nextPage" false }} +{{ $current.Scratch.Set "prevPage" false }} + +{{ template "menu-filetree-np" dict "sect" .Site.Home.Sections "current" $current "site" $site }} + +{{ define "menu-filetree-np" }} + {{ $current := .current }} + {{ $site := .site }} + + {{ $sortBy := (default "title" .current.Site.Params.geekdocFileTreeSortBy | lower) }} + {{ range .sect.GroupBy "Weight" }} + {{ $rangeBy := .ByTitle }} + + {{ if eq $sortBy "title" }} + {{ $rangeBy = .ByTitle }} + {{ else if eq $sortBy "linktitle" }} + {{ $rangeBy = .ByLinkTitle }} + {{ else if eq $sortBy "date" }} + {{ $rangeBy = .ByDate }} + {{ else if eq $sortBy "publishdate" }} + {{ $rangeBy = .ByPublishDate }} + {{ else if eq $sortBy "expirydate" }} + {{ $rangeBy = .ByExpiryDate }} + {{ else if eq $sortBy "lastmod" }} + {{ $rangeBy = .ByLastmod }} + {{ else if eq $sortBy "title_reverse" }} + {{ $rangeBy = .ByTitle.Reverse }} + {{ else if eq $sortBy "linktitle_reverse" }} + {{ $rangeBy = .ByLinkTitle.Reverse }} + {{ else if eq $sortBy "date_reverse" }} + {{ $rangeBy = .ByDate.Reverse }} + {{ else if eq $sortBy "publishdate_reverse" }} + {{ $rangeBy = .ByPublishDate.Reverse }} + {{ else if eq $sortBy "expirydate_reverse" }} + {{ $rangeBy = .ByExpiryDate.Reverse }} + {{ else if eq $sortBy "lastmod_reverse" }} + {{ $rangeBy = .ByLastmod.Reverse }} + {{ end }} + + {{ range $rangeBy }} + {{ $current.Scratch.Set "current" $current }} + {{ $current.Scratch.Set "site" $site }} + + {{ if not .Params.geekdocHidden }} + {{ $numberOfPages := (add (len .Pages) (len .Sections)) }} + {{ $site := $current.Scratch.Get "site" }} + {{ $this := . }} + {{ $current := $current.Scratch.Get "current" }} + + {{ $current.Scratch.Set "refName" (partial "utils/title" .) }} + {{ $name := $current.Scratch.Get "refName" }} + + {{ if $current.Scratch.Get "getNext" }} + {{ if or $this.Content $this.Params.geekdocFlatSection }} + {{ $current.Scratch.Set "nextPage" (dict "name" $name "this" $this) }} + {{ $current.Scratch.Set "getNext" false }} + {{ end }} + {{ end }} + + {{ if eq $current.RelPermalink $this.RelPermalink }} + {{ $current.Scratch.Set "prevPage" ($current.Scratch.Get "prev") }} + {{ $current.Scratch.Set "getNext" true }} + {{ end }} + + {{ if or $this.Content $this.Params.geekdocFlatSection }} + {{ $current.Scratch.Set "prev" (dict "name" $name "this" $this) }} + {{ end }} + + {{ $sub := and (ne $numberOfPages 0) (not .Params.geekdocFlatSection) }} + {{ if $sub }} + {{ template "menu-filetree-np" dict "sect" .Pages "current" $current }} + {{ end }} + {{ end }} + {{ end }} + + {{ end }} +{{ end }} + + + {{ with ($current.Scratch.Get "prevPage") }} + + gdoc_arrow_left_alt + {{ .name }} + + {{ end }} + + + {{ with ($current.Scratch.Get "nextPage") }} + + {{ .name }} + gdoc_arrow_right_alt + + {{ end }} + diff --git a/layouts/partials/microformats/schema.html b/layouts/partials/microformats/schema.html index e4a71eb..4204b0d 100644 --- a/layouts/partials/microformats/schema.html +++ b/layouts/partials/microformats/schema.html @@ -5,7 +5,7 @@ "@context": "http://schema.org", "@type": "WebSite", "name": {{ .Site.Title }}, - "url": {{ .Site.BaseURL }}, + "url": {{ .Site.Home.Permalink }}, {{- with partial "utils/description" . }} "description": "{{ . | plainify | htmlUnescape | chomp }}", {{- end }} @@ -57,7 +57,7 @@ "publisher":{ "@type":"Organization", "name": {{ .Site.Title }}, - "url": {{ .Site.BaseURL }}, + "url": {{ .Site.Home.Permalink }}, "logo": { "@type": "ImageObject", "url": {{ (default "brand.svg" .Site.Params.logo) | absURL }}, diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 62b2e6f..bd25775 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -8,7 +8,7 @@ placeholder="{{ i18n "form_placeholder_search" }}..." aria-label="{{ i18n "form_placeholder_search" }}" maxlength="64" - data-site-base-url="{{ .Site.BaseURL }}" + data-site-base-url="{{ "" | absURL }}" data-site-lang="{{ .Site.Language.Lang }}" /> diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index 022c10a..07aabf1 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -13,7 +13,7 @@ {{ end }}
- + - + {{ i18n "button_homepage" }} diff --git a/layouts/shortcodes/avatar.html b/layouts/shortcodes/avatar.html new file mode 100644 index 0000000..1d64429 --- /dev/null +++ b/layouts/shortcodes/avatar.html @@ -0,0 +1,57 @@ +{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} +{{- $customAlt := .Get "alt" }} +{{- $customSize := .Get "size" | lower }} +{{- $customAnchor := default "smart" (.Get "anchor") | title }} +{{- $data := newScratch }} + +{{- with $source }} + {{- $caption := default .Title $customAlt }} + {{- $isSVG := (eq .MediaType.SubType "svg") }} + {{- $origin := . -}} + + {{- if $isSVG }} + {{- $data.SetInMap "size" "tiny" "160" }} + {{- $data.SetInMap "size" "small" "300" }} + {{- $data.SetInMap "size" "medium" "600" }} + {{- $data.SetInMap "size" "large" "900" }} + {{- else }} + {{- $data.SetInMap "size" "tiny" (printf "160x160 %s" $customAnchor) }} + {{- $data.SetInMap "size" "small" (printf "300x300 %s" $customAnchor) }} + {{- $data.SetInMap "size" "medium" (printf "600x600 %s" $customAnchor) }} + {{- $data.SetInMap "size" "large" (printf "900x900 %s" $customAnchor) }} + {{- end -}} + +
+
+ + + {{- $size := $data.Get "size" }} + {{- if not $isSVG }} + {{- if ne $customSize "origin" }} + + {{- end }} + {{- end }} + {{ $caption }} + + +
+
+{{- end }} diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 70f38c3..f0bbb6b 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -7,64 +7,58 @@ {{- with $source }} {{- $caption := default .Title $customAlt }} {{- $isSVG := (eq .MediaType.SubType "svg") }} + {{- $origin := . }} - {{- $origin := .Permalink }} {{- if $isSVG }} - {{- $data.SetInMap "size" "profile" "180" }} {{- $data.SetInMap "size" "tiny" "320" }} {{- $data.SetInMap "size" "small" "600" }} {{- $data.SetInMap "size" "medium" "1200" }} {{- $data.SetInMap "size" "large" "1800" }} {{- else }} - {{- $data.SetInMap "size" "profile" (.Fill "180x180 Center").Permalink }} - {{- $data.SetInMap "size" "tiny" (.Resize "320x").Permalink }} - {{- $data.SetInMap "size" "small" (.Resize "600x").Permalink }} - {{- $data.SetInMap "size" "medium" (.Resize "1200x").Permalink }} - {{- $data.SetInMap "size" "large" (.Resize "1800x").Permalink }} - {{- end }} - + {{- $data.SetInMap "size" "tiny" "320x"}} + {{- $data.SetInMap "size" "small" "600x" }} + {{- $data.SetInMap "size" "medium" "1200x" }} + {{- $data.SetInMap "size" "large" "1800x" }} + {{- end -}}
-
+
{{- $size := $data.Get "size" }} {{- if not $isSVG }} + {{- if ne $customSize "origin" }} + {{- end }} {{- end }} {{ $caption }} - {{- if not (eq $customSize "profile") }} - {{- with $caption }} -
- {{ . }} - {{- with $source.Params.credits }} - {{ printf " (%s)" . | $.Page.RenderString }} - {{- end }} -
- {{- end }} + {{- with $caption }} +
+ {{ . }} + {{- with $source.Params.credits }} + {{ printf " (%s)" . | $.Page.RenderString }} + {{- end }} +
{{- end }}
diff --git a/layouts/shortcodes/propertylist.html b/layouts/shortcodes/propertylist.html index ec62a48..b97faf7 100644 --- a/layouts/shortcodes/propertylist.html +++ b/layouts/shortcodes/propertylist.html @@ -11,7 +11,8 @@ {{- $properties = (sort $properties . $order) }} {{- end }} {{- range $properties }} -
+ {{- $uniqueAnchor := anchorize (printf "%s-%s" $name .name) | safeHTML }} +
{{ .name }} {{- if .required }} {{ i18n "propertylist_required" | lower }} @@ -32,7 +33,7 @@ {{- end }} {{- end }} {{- if $showAnchor }} - + {{- end }} diff --git a/layouts/shortcodes/toc-tree.html b/layouts/shortcodes/toc-tree.html index 13148ba..4c81b5b 100644 --- a/layouts/shortcodes/toc-tree.html +++ b/layouts/shortcodes/toc-tree.html @@ -1,8 +1,10 @@ +{{- $current := . }} {{- $tocLevels := default (default 6 .Site.Params.geekdocToC) .Page.Params.geekdocToC }} +{{- $sortBy := (default (default "title" .Site.Params.geekdocFileTreeSortBy) (.Get "sortBy") | lower) }} {{- if $tocLevels }}
- {{ template "toc-tree" dict "sect" .Page.Pages }} + {{ template "toc-tree" dict "sect" .Page.Pages "current" $current "sortBy" $sortBy }}
{{- end }} @@ -10,8 +12,36 @@ {{- define "toc-tree" }}