mirror of https://github.com/docker/docs.git
Merge pull request #17984 from dvdksn/hugo-fix-go-redirects
hugo: fix /go redirects
This commit is contained in:
commit
48130331d5
|
@ -30,7 +30,6 @@ jobs:
|
||||||
set: |
|
set: |
|
||||||
*.cache-from=type=gha,scope=build
|
*.cache-from=type=gha,scope=build
|
||||||
*.cache-to=type=gha,scope=build,mode=max
|
*.cache-to=type=gha,scope=build,mode=max
|
||||||
*.args.HUGO_ENV=production
|
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
@ -8,7 +8,7 @@ RUN apk --update add nodejs npm git
|
||||||
|
|
||||||
FROM base as node
|
FROM base as node
|
||||||
COPY package*.json .
|
COPY package*.json .
|
||||||
RUN npm install
|
RUN npm install && npm cache clean --force
|
||||||
|
|
||||||
FROM base as hugo
|
FROM base as hugo
|
||||||
ARG HUGO_VERSION=0.116.1
|
ARG HUGO_VERSION=0.116.1
|
||||||
|
@ -24,7 +24,7 @@ FROM build-base as build
|
||||||
ARG HUGO_ENV
|
ARG HUGO_ENV
|
||||||
ARG DOCS_URL
|
ARG DOCS_URL
|
||||||
COPY . .
|
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
|
FROM scratch as release
|
||||||
COPY --from=build /out /
|
COPY --from=build /out /
|
||||||
|
|
|
@ -10,4 +10,9 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- range $target, $aliases := site.Data.redirects -}}
|
||||||
|
{{- range $aliases }}
|
||||||
|
{{- $redirects.SetInMap "paths" . $target -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
{{ $redirects.Get "paths" | jsonify }}
|
{{ $redirects.Get "paths" | jsonify }}
|
||||||
|
|
Loading…
Reference in New Issue