diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..a6810e5d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + branches: + - dev + +env: + RELEASE_TAR: ./dist/hugo-geekdoc.tar.gz + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build assets + run: npm run build + + - name: Pack + run: npm run pack + + - name: Extract release to directory + run: | + tar -xf ./dist/hugo-geekdoc.tar.gz -C ./dist; rm ./dist/hugo-geekdoc.tar.gz + + - name: Push to main branch + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: main + FOLDER: dist + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SQUASH_HISTORY: true diff --git a/.gitignore b/.gitignore index 1680e1ec..f945a558 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # local environments +.idea .swp .env* /dist/ @@ -15,9 +16,8 @@ VERSION exampleSite/content/de # auto-generated files -/data/ +/data/assets.json /static/ -/assets/sprites/ /resources/ /exampleSite/resources/ /exampleSite/data/sprites/ diff --git a/.tarignore b/.tarignore index 8a582b01..e4be11fe 100644 --- a/.tarignore +++ b/.tarignore @@ -20,6 +20,7 @@ local* dist src build +images renovate* resources CONTRIBUTING.md diff --git a/README.md b/README.md index 99358d83..31233d27 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,70 @@ -# Geekdoc +# CYBERTEC Geekdoc + +A CYBERTEC themed fork of [geekdoc](https://github.com/thegeeklab/hugo-geekdoc), a Hugo theme made for documentation. + +--- + +## Requirements + +- [`go`](https://go.dev/doc/install) +- [`hugo`](https://gohugo.io/installation/) + +## Usage + +Initialize a new hugo site: + +```shell +hugo new site +cd +``` + +Initialize the site as a go module: + +```shell +hugo mod init github.com/cybertec-postgresql/ +``` + +Add the following to your `hugo.toml` to use this theme, including functional code-highlighting: + +```toml +# hugo.toml +pygmentsCodeFences = true +pygmentsUseClasses = true + +[module] +[[module.imports]] +path = 'github.com/cybertec-postgresql/hugo-geekdoc' +``` + +Fetch the module + +```shell +hugo mod get -u +``` + +Build your page +```shell +hugo --minify +# You may optionally overwrite the `baseURL` +hugo --minify -b "/docs/" +``` + +## Update + +To retrieve the latest version of this theme, simply run + +```shell +hugo mod get -u +hugo mod tidy +``` + +## Development + +The fork and source code is located inside the `dev` branch. On push, a GitHub Actions workflow will build and push the release to the `main` branch. + +The contents below are from the original Geekdoc README. + +--- [![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) diff --git a/assets/sprites/cpo.svg b/assets/sprites/cpo.svg new file mode 100644 index 00000000..a683fd67 --- /dev/null +++ b/assets/sprites/cpo.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + diff --git a/assets/sprites/cybertec.svg b/assets/sprites/cybertec.svg new file mode 100644 index 00000000..de3222be --- /dev/null +++ b/assets/sprites/cybertec.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + diff --git a/assets/sprites/cypex.svg b/assets/sprites/cypex.svg new file mode 100644 index 00000000..07910f92 --- /dev/null +++ b/assets/sprites/cypex.svg @@ -0,0 +1,61 @@ + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/assets/sprites/geekdoc.svg b/assets/sprites/geekdoc.svg new file mode 100644 index 00000000..4f3cfd29 --- /dev/null +++ b/assets/sprites/geekdoc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/sprites/migrator.svg b/assets/sprites/migrator.svg new file mode 100644 index 00000000..485eb76d --- /dev/null +++ b/assets/sprites/migrator.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/sprites/pgwatch.svg b/assets/sprites/pgwatch.svg new file mode 100644 index 00000000..b2ee531a --- /dev/null +++ b/assets/sprites/pgwatch.svg @@ -0,0 +1,23 @@ + + + + + + diff --git a/assets/sprites/scalefield.svg b/assets/sprites/scalefield.svg new file mode 100644 index 00000000..7df05127 --- /dev/null +++ b/assets/sprites/scalefield.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/config/_default/hugo.toml b/config/_default/hugo.toml new file mode 100644 index 00000000..4deabf1e --- /dev/null +++ b/config/_default/hugo.toml @@ -0,0 +1,9 @@ +disablePathToLower = true +enableGitInfo = true +enableRobotsTXT = true + +[taxonomies] +tag = "tags" + +[params] +geekdocCollapseAllSections = true diff --git a/data/menu/more.yaml b/data/menu/more.yaml new file mode 100644 index 00000000..ee6bbf24 --- /dev/null +++ b/data/menu/more.yaml @@ -0,0 +1,26 @@ +--- +more: + - name: CYBERTEC + icon: "cybertec" + ref: "https://www.cybertec-postgresql.com" + external: true + - name: CPO + icon: "cpo" + ref: "https://github.com/cybertec-postgresql/CYBERTEC-pg-operator" + external: true + - name: CYPEX + icon: "cypex" + ref: "https://www.cybertec-postgresql.com/en/products/cypex/" + external: true + - name: Migrator + icon: "migrator" + ref: "https://www.cybertec-postgresql.com/en/products/cybertec-migrator/" + external: true + - name: Scalefield + icon: "scalefield" + ref: "https://www.cybertec-postgresql.com/en/products/scalefield/" + external: true + - name: pgwatch + icon: "pgwatch" + ref: "https://pgwatch.com/" + external: true diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..bb973bb2 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/cybertec-postgresql/hugo-geekdoc + +go 1.22.5 diff --git a/i18n/de.yaml b/i18n/de.yaml index ae3dc99f..2dd32a5a 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -3,7 +3,7 @@ edit_page: Seite bearbeiten nav_navigation: Navigation nav_tags: Tags -nav_more: Weitere +nav_more: Weiteres nav_top: Nach oben form_placeholder_search: Suchen @@ -51,3 +51,6 @@ propertylist_default: Standardwert pagination_page_prev: vorher pagination_page_next: weiter pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" + +custom_product_of_cybertec: Ein Produkt von CYBERTEC +custom_support_button: Support diff --git a/i18n/en.yaml b/i18n/en.yaml index ff19ea4e..05c03f7d 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -51,3 +51,6 @@ propertylist_default: default pagination_page_prev: prev pagination_page_next: next pagination_page_state: "{{ .PageNumber }}/{{ .TotalPages }}" + +custom_product_of_cybertec: A product of CYBERTEC +custom_support_button: Support diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 94172f65..438a0fb6 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,11 +1,13 @@ {{ define "main" }} {{ partial "page-header" . }} +
+

{{ partial "utils/title" . }}

+
-

{{ partial "utils/title" . }}

{{ partial "utils/content" . }}
{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 94172f65..c86921ff 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,11 +1,12 @@ {{ define "main" }} {{ partial "page-header" . }} - +
+

{{ partial "utils/title" . }}

+
-

{{ partial "utils/title" . }}

{{ partial "utils/content" . }}
{{ end }} diff --git a/layouts/partials/head/favicons.html b/layouts/partials/head/favicons.html index 40a8c91d..d192342d 100644 --- a/layouts/partials/head/favicons.html +++ b/layouts/partials/head/favicons.html @@ -1,13 +1,9 @@ - - - + + + + + + + + + diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index 06f346dd..60140709 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -3,21 +3,6 @@ {{- end }} - - - {{ end }} +{{ i18n "custom_product_of_cybertec" }} {{ with ($current.Scratch.Get "nextPage") }} -

{{ i18n "nav_navigation" }}

+

{{ i18n "nav_navigation" }}

{{ if .Site.Params.geekdocMenuBundle }} {{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.main.main) }} {{ else }} @@ -37,7 +37,7 @@

{{ i18n "nav_tags" }}

{{ if .Site.Data.menu.more.more }} -

{{ i18n "nav_more" }}

+

{{ i18n "nav_more" }}

{{ partial "menu-bundle" (dict "current" . "source" .Site.Data.menu.more.more) }} {{ end }}
diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html index 31ae8e1b..180fe4f4 100644 --- a/layouts/partials/site-footer.html +++ b/layouts/partials/site-footer.html @@ -1,45 +1,18 @@
diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index 07aabf1b..1540cd92 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -57,6 +57,9 @@ {{ partial "language" .Root }} + + {{ i18n "custom_support_button" }} +