Skip to content

Conversation

@crazy-max
Copy link
Member

follow-up #14688

In the same spirit as the plugin to fetch remote resources, create a new one to update our sitemap.

Also enables sitemap generation in development so we can preview sitemap changes. Since Jekyll 4, sitemap generation is pretty well optimized and takes less than 3 seconds for our docs so I think we can enable it.

I also added another commit which adds a sitemap xsl, so we can easily browse our sitemap:

image

@netlify
Copy link

netlify bot commented May 20, 2022

Deploy Preview for docsdocker ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 29ad7e0
🔍 Latest deploy log https://app.netlify.com/sites/docsdocker/deploys/628873f395b5eb000882a96b
😎 Deploy Preview https://deploy-preview-14784--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@crazy-max
Copy link
Member Author

Here is the preview link for the sitemap: https://deploy-preview-14784--docsdocker.netlify.app/sitemap.xml

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the update-sitemap-plugin branch from 843a99c to 50d5358 Compare May 20, 2022 13:26
Comment on lines -67 to +66
sed -i 's#\(<a[^>]* href="\)https://${DOMAIN}/#\1/#g' "$i"
sed -i 's#\(<a[^>]* href="\)${DOCS_URL}/#\1/#g' "$i"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check this one; I think the intent here was to remove some hard-coded URLs in the docs (e.g. from upstream MarkDown files) that have a full https://docs.docker.com/ URL in them

URLs in the pages generated by Jekyll are expected to all be relative (so <a href=/foo/bar/>, without a domain); the intent of that is so that the generated pages can be deployed to "any" domain (staging/local/elsewhere) without links going to the "live" domain.

So perhaps that part was intentionally set to docs.docker.com

As to the sitemap.xml having docs.docker.com hard-coded; that may also have been intentional at the time, as we've had cases where Google found preview sites, and (although we set noindex headers), we wanted to avoid it finding the sitemap.xml, and as a result indexing those preview domains (and as a "best effort", we just pointed it to the live website, which was the "least bad" option.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the update-sitemap-plugin branch from 50d5358 to 29ad7e0 Compare May 21, 2022 05:09
@crazy-max crazy-max marked this pull request as draft May 21, 2022 07:44
@usha-mandya usha-mandya added the area/ux Issue affects functionality of docs.docker.com label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ux Issue affects functionality of docs.docker.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants