Skip to content

Commit

Permalink
Minor version-agnostic page path tweaks (#397)
Browse files Browse the repository at this point in the history
* Minor version-agnostic page path tweaks

- Adjust the Upcoming Releases page path
- Add the contribution guides
- Add a comment

* Fix version-agnostic page paths

These require an exact match to be deemed version agnostic, so remove
the `contributing/` item and replace it with each page path within the
"Contribute to Teleport Documentation" section.
  • Loading branch information
ptgott authored Sep 27, 2023
1 parent 3984b00 commit 79c7f59
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion utils/useVersionAgnosticPages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import { getPathWithoutVersion } from "./url";

const agnost = ["preview/upcoming-releases/", "changelog/"];
// Paths including these segments are version agnostic. If a URL path includes
// one of these segments when a user visits a page via a navigation link:
// - The docs site will render the default version of the page
// - The version switcher will be disabled on the page
const agnost = [
"upcoming-releases/",
"changelog/",
"contributing/documentation/",
"contributing/documentation/reviewing-docs/",
"contributing/documentation/issues/",
"contributing/documentation/style-guide/",
"contributing/documentation/reference/",
"contributing/documentation/how-to-contribute/",
];

export const useVersionAgnosticPages = () => {
const isVersionAgnosticPage = (route: string) => {
Expand Down

1 comment on commit 79c7f59

@vercel
Copy link

@vercel vercel bot commented on 79c7f59 Sep 27, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.