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

docs: add-current-path-to-version-switcher #15860

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NicholasFlamy
Copy link
Member

Adds the path of the page you are on to the version switcher options so that you can quickly view changes on the page you are on.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 2, 2025
@NicholasFlamy
Copy link
Member Author

This updates the feature added in #10091

@@ -49,7 +49,7 @@ export default function VersionSwitcher(): JSX.Element {
mobile={windowSize === 'mobile'}
items={versions.map(({ label, url }) => ({
label,
to: url,
to: url + location.pathname,
Copy link
Member Author

Choose a reason for hiding this comment

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

I figured this was the simplest way to do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

If using a var equal to location.pathname and then referencing that var here is better, let me know.

Copy link
Contributor

github-actions bot commented Feb 2, 2025

📖 Documentation deployed to pr-15860.preview.immich.app

@NicholasFlamy NicholasFlamy marked this pull request as ready for review February 2, 2025 19:42
@NicholasFlamy NicholasFlamy marked this pull request as draft February 2, 2025 20:24
@NicholasFlamy
Copy link
Member Author

I'm not sure about the official docs build process. I know that for the initial implementation of the version switcher that it only had the current docs but older docs were added shortly after. The older docs had to be modified with the version switcher. This PR would need to take effect on the archived docs.

@NicholasFlamy NicholasFlamy force-pushed the docs-version-switcher-use-current-path branch from 3ba3c5c to 7eb6ecc Compare February 2, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:documentation documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant