From 86a1879956777b401d155f1c447bc48bd5557355 Mon Sep 17 00:00:00 2001 From: Hector Vido Date: Wed, 4 Feb 2026 15:11:12 -0300 Subject: [PATCH] Upgrade hugo, organize folders and files --- .gitmodules | 6 + Dockerfile | 12 +- Makefile | 4 +- archetypes/default.md | 5 + hack/codeescape.sh | 11 - config.yaml => hugo.yaml | 0 layouts/index.html | 3 - layouts/partials/head-css.html | 49 ---- layouts/partials/head.html | 325 --------------------- package-lock.json | 3 - themes/docsy | 2 +- themes/github.com/FortAwesome/Font-Awesome | 1 + themes/github.com/twbs/bootstrap | 1 + 13 files changed, 27 insertions(+), 395 deletions(-) create mode 100644 archetypes/default.md delete mode 100755 hack/codeescape.sh rename config.yaml => hugo.yaml (100%) delete mode 100644 layouts/index.html delete mode 100644 layouts/partials/head-css.html delete mode 100644 layouts/partials/head.html delete mode 100644 package-lock.json create mode 160000 themes/github.com/FortAwesome/Font-Awesome create mode 160000 themes/github.com/twbs/bootstrap diff --git a/.gitmodules b/.gitmodules index b76244d3..3bb4d12b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ +[submodule "themes/github.com/twbs/bootstrap"] + path = themes/github.com/twbs/bootstrap + url = https://github.com/twbs/bootstrap.git +[submodule "themes/github.com/FortAwesome/Font-Awesome"] + path = themes/github.com/FortAwesome/Font-Awesome + url = https://github.com/FortAwesome/Font-Awesome.git [submodule "themes/docsy"] path = themes/docsy url = https://github.com/google/docsy.git diff --git a/Dockerfile b/Dockerfile index 6d46a18a..0394a12c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,18 @@ -FROM klakegg/hugo:0.111.3-ext-ubuntu as builder +FROM registry.access.redhat.com/ubi10/ubi as builder + +ARG HUGO_VERSION=0.155.2 + +WORKDIR /src + +RUN dnf install -y golang git nodejs +RUN curl -sL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz \ + | tar -C /usr/bin -xzf - hugo COPY . /src/ RUN set -x && HUGO_ENV=production make generate -FROM nginxinc/nginx-unprivileged:1.18-alpine +FROM nginxinc/nginx-unprivileged:1.29-alpine COPY --from=builder /src/public/ /usr/share/nginx/html/ COPY --from=builder /src/static/googlea8e04f239c597b8a.html /usr/share/nginx/html/ diff --git a/Makefile b/Makefile index d8debd6d..b0159141 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,4 @@ generate: - npm install -D --unsafe-perm=true --save postcss postcss-cli autoprefixer && cd themes/docsy && git submodule update -f --init && cd ../.. && hugo --gc --minify + npm install --save-dev postcss postcss-cli autoprefixer && git submodule update -f --init && hugo --gc --minify +image: + podman build -t ci-docs -f Dockerfile . diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 00000000..25b67521 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +date = '{{ .Date }}' +draft = true +title = '{{ replace .File.ContentBaseName "-" " " | title }}' ++++ diff --git a/hack/codeescape.sh b/hack/codeescape.sh deleted file mode 100755 index 6ff22355..00000000 --- a/hack/codeescape.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -getRegex() { - echo -n "s/\b(? - - diff --git a/layouts/partials/head-css.html b/layouts/partials/head-css.html deleted file mode 100644 index a3d018e8..00000000 --- a/layouts/partials/head-css.html +++ /dev/null @@ -1,49 +0,0 @@ - -{{ $scssMain := "scss/main.scss"}} -{{ if .Site.IsServer }} -{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}} -{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) }} - -{{ else }} -{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" false) | postCSS | minify | fingerprint }} - - -{{ end }} - -{{/* Everything above here is copied from themes/docsy/layouts/partials/head-css.html to add the below section */}} - - diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index b36d176c..00000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,325 +0,0 @@ - - -{{ hugo.Generator }} -{{- $outputFormat := partial "outputformat.html" . -}} - -{{ range .AlternativeOutputFormats -}} - -{{ end -}} - -{{ if and hugo.IsProduction (ne $outputFormat "print") -}} - -{{ else -}} - -{{ end -}} - -{{ partialCached "favicons.html" . }} -{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }} -{{- template "_internal/opengraph.html" . -}} -{{- template "_internal/schema.html" . -}} -{{- template "_internal/twitter_cards.html" . -}} -{{ if hugo.IsProduction }} -{{ template "_internal/google_analytics_async.html" . }} -{{ end }} -{{ partialCached "head-css.html" . "asdf" }} - -{{ if .Site.Params.offlineSearch }} - -{{end}} -{{ if .Site.Params.prism_syntax_highlighting }} - - -{{ end }} -{{ partial "hooks/head-end.html" . }} -{{/* Everything above here is copied from themes/docsy/layouts/partials/head.html to add the below section */}} - - diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 48e341a0..00000000 --- a/package-lock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lockfileVersion": 1 -} diff --git a/themes/docsy b/themes/docsy index b2ce2477..bbf68d4c 160000 --- a/themes/docsy +++ b/themes/docsy @@ -1 +1 @@ -Subproject commit b2ce24771935100ef840a942192c7b303e93a7df +Subproject commit bbf68d4caae52e8c9a89964c3d04b383ee678d44 diff --git a/themes/github.com/FortAwesome/Font-Awesome b/themes/github.com/FortAwesome/Font-Awesome new file mode 160000 index 00000000..af620534 --- /dev/null +++ b/themes/github.com/FortAwesome/Font-Awesome @@ -0,0 +1 @@ +Subproject commit af620534bfc3c2d4cbefcfeec29603bbe7809e64 diff --git a/themes/github.com/twbs/bootstrap b/themes/github.com/twbs/bootstrap new file mode 160000 index 00000000..25aa8cc0 --- /dev/null +++ b/themes/github.com/twbs/bootstrap @@ -0,0 +1 @@ +Subproject commit 25aa8cc0b32f0d1a54be575347e6d84b70b1acd7