diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1505f74a3e..7836bb561e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index d0dd010fc6..0fe13761b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 / diff --git a/_redirects.yml b/data/redirects.yml similarity index 100% rename from _redirects.yml rename to data/redirects.yml diff --git a/layouts/index.redirects.json b/layouts/index.redirects.json index 6bc867b563..fe1162e574 100644 --- a/layouts/index.redirects.json +++ b/layouts/index.redirects.json @@ -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 }}