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

Use environment variable to control indexing of rendered docs #15664

Closed
jeremystretch opened this issue Apr 8, 2024 · 0 comments
Closed

Use environment variable to control indexing of rendered docs #15664

jeremystretch opened this issue Apr 8, 2024 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user

Comments

@jeremystretch
Copy link
Member

jeremystretch commented Apr 8, 2024

Proposed Changes

When the NetBox documentation is rendered using mkdocs, we ensure that indexing by search engines is disabled unless it has been built for ReadTheDocs. This is done to avoid search engines accidentally caching the local documentation served by publicly-exposed NetBox deployments in the wild, which taints search results.

This is currently accomplished by checking that the page.canonical_url context variable is set to docs.netbox.dev:

{% if page.canonical_url != 'https://docs.netbox.dev/' %}
<meta name="robots" content="noindex">
{% endif %}

This approach is taken because ReadTheDocs currently does not support the use of environment variables within mkdocs configuration files. However, per this recent blog post, support for referencing environment variables will be introduced on April 15. (See also this comment.)

I've opened this issue to track the switch to using an environment variable instead of the context variable (essentially reverting efd8652).

Justification

The environment approach is more flexible as it more customizable and does not rely on an exact string match.

@jeremystretch jeremystretch added type: housekeeping Changes to the application which do not directly impact the end user status: blocked Another issue or external requirement is preventing implementation labels Apr 8, 2024
@jeremystretch jeremystretch self-assigned this Apr 8, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user and removed type: housekeeping Changes to the application which do not directly impact the end user status: blocked Another issue or external requirement is preventing implementation labels Apr 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: housekeeping Changes to the application which do not directly impact the end user
Projects
None yet
Development

No branches or pull requests

1 participant