Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compiler] Add sitemap to doc generator #8348

Merged

Conversation

straight-shoota
Copy link
Member

The doc generator can produce a sitemap.xml which lists all HTML pages accessible for search engines. The goal is to use this sitemap to assign lower priorities to outdated doc pages on https://crystal-lang.org/api/ to make the most recent release (latest) show up first in search results. See crystal-lang/crystal-website#79 for details. Having such a sitemap is generally useful for shards as well, so it makes sense to directly integrate it into the docs generator.

Sitemaps are only generated when --sitemap-base-url=URL option is set. Sitemaps require absolute paths, so it can't be produced without a base url. Additional options are --sitemap-priority and --sitemap-changefreq which correspond do the respective sitemap features.

This also reverts #5990 which tried an alternative approach to solving the search priority issue using canonical URLs. But this completely removes older versions from search results.

Ideally, sitemap.xml should be compressed, but the compiler is supposed to be built without libz, so this needs to be done separately.

Makefile Outdated Show resolved Hide resolved
This is useful for specs where all the configuration options are
irrelevant.
@straight-shoota straight-shoota merged commit 42bab8d into crystal-lang:master Oct 30, 2019
@straight-shoota straight-shoota deleted the feature/docs-sitemap branch October 30, 2019 12:35
@bcardiff bcardiff added this to the 0.32.0 milestone Dec 6, 2019
straight-shoota added a commit to straight-shoota/crystal that referenced this pull request Nov 14, 2020
The previous attempt to use sitemaps to indicate preference of latest
version over older ones to search engines doesn't seem to work.
Instead, the solution applied for similar situations is canonical
links. This mostly reinstates the canonical link behaviour prior to
crystal-lang#8348
bcardiff pushed a commit that referenced this pull request Dec 1, 2020
The previous attempt to use sitemaps to indicate preference of latest
version over older ones to search engines doesn't seem to work.
Instead, the solution applied for similar situations is canonical
links. This mostly reinstates the canonical link behaviour prior to
#8348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants