From 29546c24f3b032a8013f6dedede9ec1740b92a85 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 25 Sep 2020 17:45:17 +0200 Subject: [PATCH] Use absolute URLs in sitemap.xml We generate the website with relative URLs to allow hosting the content on preview domains. However, the sitemap.xml should always contain absolute URLs (including the domain name). I couldn't find a way to configure the sitemap URL's separately, so using the same hack we use for stripping URL's in the HTML. Before this, the sitemap.xml would contain; /engine/reference/commandline/volume_prune/ After this, the full URL is included https://docs.docker.com/engine/reference/commandline/volume_prune/ Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c411bd1069..a0555ed72d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,7 +54,8 @@ COPY --from=upstream-resources /usr/src/app/md_source/. ./ # API docs, based on the latest_engine_api_version parameter in _config.yml RUN ./_scripts/update-api-toc.sh RUN jekyll build -d ${TARGET} \ - && find ${TARGET} -type f -name '*.html' | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done + && find ${TARGET} -type f -name '*.html' | while read i; do sed -i 's#href="https://docs.docker.com/#href="/#g' "$i"; done \ + && sed -i 's#/#https://docs.docker.com/#' "${TARGET}/sitemap.xml" # This stage only contains the generated files. It can be used to host the