Merge pull request #17984 from dvdksn/hugo-fix-go-redirects

hugo: fix /go redirects
This commit is contained in:
David Karlsson 2023-08-22 22:54:05 +02:00 committed by GitHub
commit 48130331d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -30,7 +30,6 @@ jobs:
set: |
*.cache-from=type=gha,scope=build
*.cache-to=type=gha,scope=build,mode=max
*.args.HUGO_ENV=production
validate:
runs-on: ubuntu-20.04

View File

@ -8,7 +8,7 @@ RUN apk --update add nodejs npm git
FROM base as node
COPY package*.json .
RUN npm install
RUN npm install && npm cache clean --force
FROM base as hugo
ARG HUGO_VERSION=0.116.1
@ -24,7 +24,7 @@ FROM build-base as build
ARG HUGO_ENV
ARG DOCS_URL
COPY . .
RUN /bin/hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL
RUN hugo --gc --minify -d /out -e $HUGO_ENV -b $DOCS_URL
FROM scratch as release
COPY --from=build /out /

View File

@ -10,4 +10,9 @@
{{- end -}}
{{- end -}}
{{- end -}}
{{- range $target, $aliases := site.Data.redirects -}}
{{- range $aliases }}
{{- $redirects.SetInMap "paths" . $target -}}
{{- end -}}
{{- end -}}
{{ $redirects.Get "paths" | jsonify }}