Skip to content

Adding the Sphinx sitemap extension #32

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lumenCodes
Copy link

I successfully created a local version on my laptop. I then updated the conf.py with the extension name and the baseurl and then updated the requirements.txt file with the name of the extension.

I got an error
File "C:\Users\USER\Desktop\Open Source\salt-install-guide\.nox\docs-html-gen_sitevars-true-clean-true\Lib\site-packages\sphinx\registry.py", line 544, in load_extension raise ExtensionError( __('Could not import extension %s') % extname, err ) from err sphinx.errors.ExtensionError: Could not import extension sphinx-sitemap (exception: No module named 'sphinx-sitemap')

I am sure I did everything well.

@lumenCodes
Copy link
Author

@scriptautomate-bc please review.

Thanks

Copy link
Contributor

@scriptautomate-bc scriptautomate-bc left a comment

Choose a reason for hiding this comment

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

Rebase with latest from main, as I've made some updates to how version should be latest, among other changes (#33). My changes in main, plus my suggestion feedback to your PR, I think should prep it for working.

After rebasing and applying my suggestions, make sure to do a pre-commit run --all with all of these updates locally, just in case any autofixes need to be applied.

On your local system, make sure to confirm that the generated /docs/_build/html/sitemaps.xml lists URLs in the expected format of endpoint pages under https://docs.saltproject.io/salt/install-guide/en/latest/*.

@@ -149,6 +150,7 @@ def setup(app):
html_show_sourcelink = True # False on private repos; True on public repos
html_theme = "furo"
html_title = "Salt install guide"
html_baseurl = "https://docs.saltproject.io/salt/install-guide/en/latest/"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
html_baseurl = "https://docs.saltproject.io/salt/install-guide/en/latest/"
html_baseurl = "https://docs.saltproject.io/salt/install-guide/"
# Extends baseurl, in combination with version value
sitemap_locales = ["en"]
# Pages we don't care to include in generated sitemap file
sitemap_excludes = [
"search.html",
"genindex.html",
]

docs/conf.py Outdated
@@ -116,6 +116,7 @@ def setup(app):
"sphinx-prompt", # Required by sphinx_substitution_extensions
"sphinx_inline_tabs",
"sphinx_substitution_extensions",
"sphinx-sitemap",
Copy link
Contributor

Choose a reason for hiding this comment

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

You are referring to the sitemap extension incorrectly again. Refer to the sitemap documentation or the latest version of the user guide.

@lumenCodes lumenCodes marked this pull request as ready for review May 10, 2025 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants