diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index e946021..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "env": { - "browser": true, - "es2017": true - }, - "extends": ["plugin:prettier/recommended"], - "parser": "@babel/eslint-parser", - "parserOptions": { - "sourceType": "module", - "requireConfigFile": false - }, - "plugins": ["prettier"] -} diff --git a/.lighthouserc.yml b/.lighthouserc.yml index 978d57e..95c12ce 100644 --- a/.lighthouserc.yml +++ b/.lighthouserc.yml @@ -8,7 +8,7 @@ ci: - http://localhost/404.html - http://localhost/usage/getting-started/ settings: - chromeFlags: "--no-sandbox" + chromeFlags: "--no-sandbox --headless --disable-dev-shm-usage" onlyCategories: ["performance", "accessibility", "best-practices", "seo"] skipAudits: [ diff --git a/.lycheeignore b/.lycheeignore index bbe71df..2e1f506 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -1,3 +1,4 @@ https://github.com/thegeeklab/.+/edit/main/.* https://unsplash.com.* https://www.color-hex.com.* +https://geekdocs.de/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..b009dfb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/.woodpecker/docs.yml b/.woodpecker/docs.yml index cec3765..27122e1 100644 --- a/.woodpecker/docs.yml +++ b/.woodpecker/docs.yml @@ -44,7 +44,7 @@ steps: - event: [pull_request] - name: build - image: quay.io/thegeeklab/hugo:0.124.1 + image: quay.io/thegeeklab/hugo:0.143 commands: - hugo --panicOnWarning -s exampleSite/ diff --git a/.woodpecker/notify.yml b/.woodpecker/notify.yml index 9957125..374a96a 100644 --- a/.woodpecker/notify.yml +++ b/.woodpecker/notify.yml @@ -13,12 +13,12 @@ steps: settings: homeserver: from_secret: matrix_homeserver - password: - from_secret: matrix_password - roomid: - from_secret: matrix_roomid - username: - from_secret: matrix_username + room_id: + from_secret: matrix_room_id + user_id: + from_secret: matrix_user_id + access_token: + from_secret: matrix_access_token when: - status: [success, failure] diff --git a/.woodpecker/test.yml b/.woodpecker/test.yml index 19afeee..68bc870 100644 --- a/.woodpecker/test.yml +++ b/.woodpecker/test.yml @@ -16,6 +16,7 @@ steps: - name: assets image: docker.io/library/node:lts + depends_on: [eslint] commands: - npm install --quiet --no-progress - npm run build @@ -23,14 +24,15 @@ steps: FORCE_COLOR: "true" - name: testbuild - image: quay.io/thegeeklab/hugo:0.124.1 + image: quay.io/thegeeklab/hugo:0.143 + depends_on: [assets] commands: - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/${CI_REPO_NAME} - hugo --panicOnWarning -s exampleSite/ -b http://localhost:8000/ - name: html-validation image: docker.io/library/node:lts - group: test + depends_on: [testbuild] commands: - npm install --quiet --no-progress - npm run lint:html @@ -39,13 +41,13 @@ steps: - name: link-validation image: docker.io/lycheeverse/lychee - group: test + depends_on: [testbuild] commands: - lychee --no-progress --format detailed exampleSite/content/ README.md - name: page-validation - image: quay.io/thegeeklab/lhci:0.13 - group: test + image: quay.io/thegeeklab/lhci:0.14 + depends_on: [testbuild] commands: - lhci autorun environment: diff --git a/README.md b/README.md index 99358d8..b03365f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Geekdoc [![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/hugo-geekdoc/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.124-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) [![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) [![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..42e87cb --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,22 @@ +import eslint from "@eslint/js"; +import globals from "globals"; +import babelParser from "@babel/eslint-parser"; +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; + +export default [ + eslint.configs.recommended, + { + languageOptions: { + globals: { + ...globals.browser, + }, + parser: babelParser, + ecmaVersion: 2022, + sourceType: "module", + parserOptions: { + requireConfigFile: false, + }, + }, + }, + eslintPluginPrettierRecommended, +]; diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml index 53de5ee..f848cbb 100644 --- a/exampleSite/config/_default/config.yaml +++ b/exampleSite/config/_default/config.yaml @@ -41,4 +41,5 @@ outputs: security: exec: allow: + - "^git$" - "^asciidoctor$" diff --git a/exampleSite/config/_default/params.yaml b/exampleSite/config/_default/params.yaml index dcbbdc8..992023f 100644 --- a/exampleSite/config/_default/params.yaml +++ b/exampleSite/config/_default/params.yaml @@ -11,6 +11,7 @@ geekdocTagsToMenu: true geekdocRepo: https://github.com/thegeeklab/hugo-geekdoc geekdocEditPath: edit/main/exampleSite +geekdocPageLastmod: false geekdocSearch: true geekdocSearchShowParent: true diff --git a/exampleSite/content/en/_index.md b/exampleSite/content/en/_index.md index 20682f1..ca15911 100644 --- a/exampleSite/content/en/_index.md +++ b/exampleSite/content/en/_index.md @@ -9,7 +9,7 @@ geekdocAnchor: false [![Build Status](https://ci.thegeeklab.de/api/badges/thegeeklab/hugo-geekdoc/status.svg)](https://ci.thegeeklab.de/repos/thegeeklab/hugo-geekdoc) -[![Hugo Version](https://img.shields.io/badge/hugo-0.112-blue.svg)](https://gohugo.io) +[![Hugo Version](https://img.shields.io/badge/hugo-0.124-blue.svg)](https://gohugo.io) [![GitHub release](https://img.shields.io/github/v/release/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/releases/latest) [![GitHub contributors](https://img.shields.io/github/contributors/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/graphs/contributors) [![License: MIT](https://img.shields.io/github/license/thegeeklab/hugo-geekdoc)](https://github.com/thegeeklab/hugo-geekdoc/blob/main/LICENSE) diff --git a/exampleSite/content/en/features/theming/_index.md b/exampleSite/content/en/features/theming/_index.md index d443316..885b441 100644 --- a/exampleSite/content/en/features/theming/_index.md +++ b/exampleSite/content/en/features/theming/_index.md @@ -58,4 +58,33 @@ If you want to add more Favicon formats you have to [overwrite](https://gohugo.i ``` +## Fonts + +To use a custom font, it needs to be specified first. While there are many ways to do this, we recommend to use `@font-face` as it supports local as well as remote fonts. If you want to serve the fonts from your own server, you have to place them in the `static/fonts` folder of your project. + +The font registration is done in the `custom.css` file. There are also a few custom CSS properties available to simplify the usage of custom fonts. + +**Example:** + + +```css +@font-face { + font-family: "DancingScript"; + src: + url("fonts/DancingScript.woff2") format("woff2"), + url("fonts/DancingScript.woff") format("woff"); + font-weight: normal; + font-style: normal; + font-display: swap; +} + +:root { + --code-max-height: 60rem; + + --header-font-family: "DancingScript"; + --body-font-family: "DancingScript"; + --code-font-family: "DancingScript"; +} +``` + Happy customizing! diff --git a/exampleSite/content/en/shortcodes/hints.md b/exampleSite/content/en/shortcodes/hints.md index a4d728a..ed933f2 100644 --- a/exampleSite/content/en/shortcodes/hints.md +++ b/exampleSite/content/en/shortcodes/hints.md @@ -28,31 +28,31 @@ Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclima {{< hint type=note >}} **Markdown content**\ -Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. +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. {{< /hint >}} {{< hint type=tip >}} **Markdown content**\ -Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. +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. {{< /hint >}} {{< hint type=important >}} **Markdown content**\ -Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. +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. {{< /hint >}} {{< hint type=caution >}} **Markdown content**\ -Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. +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. {{< /hint >}} {{< hint type=warning >}} **Markdown content**\ -Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. +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. Romanesque acclimates investiture. diff --git a/exampleSite/content/en/usage/configuration.md b/exampleSite/content/en/usage/configuration.md index ee0235e..588baa0 100644 --- a/exampleSite/content/en/usage/configuration.md +++ b/exampleSite/content/en/usage/configuration.md @@ -70,6 +70,10 @@ enableRobotsTXT = true # You can also specify this parameter per page in front matter. geekdocEditPath = "edit/main/exampleSite" + # (Optional, default false) Show last modification date of the page in the header. + # Keep in mind that last modification date works best if `enableGitInfo` is set to true. + geekdocPageLastmod = true + # (Optional, default true) Enables search function with flexsearch. # Index is built on the fly and might slow down your website. geekdocSearch = false @@ -196,6 +200,10 @@ params: # You can also specify this parameter per page in front matter. geekdocEditPath: edit/main/exampleSite + # (Optional, default false) Show last modification date of the page in the header. + # Keep in mind that last modification date works best if `enableGitInfo` is set to true. + geekdocPageLastmod: true + # (Optional, default true) Enables search function with flexsearch. # Index is built on the fly and might slow down your website. geekdocSearch: false @@ -294,6 +302,9 @@ geekdocRepo = "https://github.com/thegeeklab/hugo-geekdoc" # the parent directory of the 'content' folder. geekdocEditPath = "edit/main/exampleSite" +# Show last modification date of the page in the header. +geekdocPageLastmod = true + # Used for 'Edit page' link, set to '.File.Path' by default. # Can be overwritten by a path relative to 'geekdocEditPath' geekdocFilePath = @@ -354,6 +365,9 @@ geekdocRepo: "https://github.com/thegeeklab/hugo-geekdoc" # the parent directory of the 'content' folder. geekdocEditPath: "edit/main/exampleSite" +# Show last modification date of the page in the header. +geekdocPageLastmod: true + # Used for 'Edit page' link, set to '.File.Path' by default. # Can be overwritten by a path relative to 'geekdocEditPath' geekdocFilePath: diff --git a/exampleSite/static/custom.css.example b/exampleSite/static/custom.css.example index 93e21cd..aad406a 100644 --- a/exampleSite/static/custom.css.example +++ b/exampleSite/static/custom.css.example @@ -2,6 +2,10 @@ :root { --code-max-height: 60rem; + + --header-font-family: "DancingScript"; + --body-font-family: "DancingScript"; + --code-font-family: "DancingScript"; } /* Light mode theming */ @@ -152,3 +156,13 @@ --footer-link-color-visited: #ffcc5c; } } + +@font-face { + font-family: "DancingScript"; + src: + url("fonts/DancingScript.woff2") format("woff2"), + url("fonts/DancingScript.woff") format("woff"); + font-weight: normal; + font-style: normal; + font-display: swap; +} diff --git a/i18n/da.yaml b/i18n/da.yaml new file mode 100644 index 0000000..2ba96ea --- /dev/null +++ b/i18n/da.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Rediger side + +nav_navigation: Navigation +nav_tags: Tags +nav_more: Mere +nav_top: Til toppen + +form_placeholder_search: Søg + +error_page_title: Faret vild? Bare rolig +error_message_title: Lost? +error_message_code: Fejl 404 +error_message_text: > + Det du leder efter kan ikke findes. Bare rolig, du kan komme tilbage til + forsiden. + +button_toggle_dark: Skift Dark/Light/Auto mode +button_nav_open: Åben navigation +button_nav_close: Luk navigation +button_menu_open: Åben menubar +button_menu_close: Luk menubar +button_homepage: Tilbage til forsiden + +title_anchor_prefix: "Link til:" + +posts_read_more: Læs fulde indlæg +posts_read_time: + one: "Et minut at gennemlæse" + other: "{{ . }} minutter at gennemlæse" +posts_update_prefix: Opdateret den +posts_count: + one: "Et indlæg" + other: "{{ . }} indlæg" +posts_tagged_with: Alle indslag tagget med '{{ . }}' + +footer_build_with: > + Bygget med Hugo og + +footer_legal_notice: Forretningsbetingelser +footer_privacy_policy: Privatlivspolitik +footer_content_license_prefix: > + Indhold licenseret under + +language_switch_no_tranlation_prefix: "Indlæg ikke oversat:" + +propertylist_required: påkrævet +propertylist_optional: valgfri +propertylist_default: udgangspunkt + +pagination_page_prev: forrige +pagination_page_next: næste +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/i18n/oc.yaml b/i18n/oc.yaml new file mode 100644 index 0000000..a68685f --- /dev/null +++ b/i18n/oc.yaml @@ -0,0 +1,53 @@ +--- +edit_page: Modificar la pagina + +nav_navigation: Navegacion +nav_tags: Etiquetas +nav_more: Mai +nav_top: Tornar ennaut + +form_placeholder_search: Cercar + +error_page_title: Perdut ? Cap de problèma +error_message_title: Perdut ? +error_message_code: Error 404 +error_message_text: > + Sembla que cercatz quicòm que se pòt pas trobat. Vos’n fagatz pas vos podèm + tornar a la pagina d’acuèlh. + +button_toggle_dark: Alternar lo mòde escur/clar/auto +button_nav_open: Dobrir la navegacion +button_nav_close: Tampar la navegacion +button_menu_open: Dobrir la barra de menú +button_menu_close: Tampar la barra de menú +button_homepage: Tornar a la pagina d’acuèlh + +title_anchor_prefix: "Ancorar a:" + +posts_read_more: Legir la publicacion complèta +posts_read_time: + one: "Una minuta de lectura" + other: "{{ . }} minutas de lectura" +posts_update_prefix: Actualizada lo +posts_count: + one: "Una publicacion" + other: "{{ . }} publicacions" +posts_tagged_with: Totas las publicacions amb '{{ . }}' + +footer_build_with: > + Construch amb Hugo e + +footer_legal_notice: Mencions legalas +footer_privacy_policy: politica de confidencialitat +footer_content_license_prefix: > + Contengut sota licéncia + +language_switch_no_tranlation_prefix: "Pagina non traducha :" + +propertylist_required: requerit +propertylist_optional: opcional +propertylist_default: per defaut + +pagination_page_prev: prec. +pagination_page_next: seg. +pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 94172f6..64bc887 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -6,6 +6,7 @@ class="gdoc-markdown gdoc-markdown__align--{{ default "left" (.Page.Params.geekdocAlign | lower) }}" >

{{ partial "utils/title" . }}

+ {{ partial "page-metadata" . }} {{ partial "utils/content" . }} {{ end }} diff --git a/layouts/partials/language.html b/layouts/partials/language.html index fdcafd2..b796cd6 100644 --- a/layouts/partials/language.html +++ b/layouts/partials/language.html @@ -1,4 +1,4 @@ -{{ if .Site.IsMultiLingual }} +{{ if hugo.IsMultilingual }}