From c8be3e9320320d99c781a09203659a797f66eeb8 Mon Sep 17 00:00:00 2001 From: Forrest Evans Date: Thu, 12 Dec 2024 14:19:11 -0800 Subject: [PATCH 1/3] Adds a Version Selector to Navbar --- docs/.vuepress/components/DocVersions.vue | 163 ++++++++++-------- docs/.vuepress/components/SidebarAnnounce.vue | 2 +- docs/.vuepress/components/navbar.vue | 11 ++ docs/.vuepress/config.ts | 4 + docs/.vuepress/styles/index.scss | 21 ++- docs/manual/old-docs.md | 2 +- 6 files changed, 124 insertions(+), 79 deletions(-) create mode 100644 docs/.vuepress/components/navbar.vue diff --git a/docs/.vuepress/components/DocVersions.vue b/docs/.vuepress/components/DocVersions.vue index b9f1ac67f..3f39f8230 100644 --- a/docs/.vuepress/components/DocVersions.vue +++ b/docs/.vuepress/components/DocVersions.vue @@ -1,55 +1,61 @@ - - + version: "Cloud", + url: `${docsBase}/docs/`, + }; + } + return { + version, + url: `${docsBase}/${version}`, + }; + }); + }; + + // Reactive property for versions + const versions = parseVersions(previousDocsVersions); + + // Handle version change + const handleVersionChange = (event: Event): void => { + const target = event.target as HTMLSelectElement; + const selectedUrl = target.value; + if (selectedUrl) { + document.location.href = selectedUrl; + } + }; + \ No newline at end of file diff --git a/docs/.vuepress/components/SidebarAnnounce.vue b/docs/.vuepress/components/SidebarAnnounce.vue index 3ccc6bd3e..93c3e1632 100644 --- a/docs/.vuepress/components/SidebarAnnounce.vue +++ b/docs/.vuepress/components/SidebarAnnounce.vue @@ -5,7 +5,7 @@

Process Automation On Prem is now Runbook Automation Self-Hosted

- + diff --git a/docs/.vuepress/components/navbar.vue b/docs/.vuepress/components/navbar.vue new file mode 100644 index 000000000..bca4591a2 --- /dev/null +++ b/docs/.vuepress/components/navbar.vue @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index f6ef837cc..614f8fd22 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -292,6 +292,10 @@ export default defineUserConfig({ __dirname, "./components/notFoundCustom.vue", ), + "@theme-hope/modules/navbar/components/Navbar": path.resolve( + __dirname, + "./components/DocVersions.vue", + ), }, //Plugins Config plugins: [ diff --git a/docs/.vuepress/styles/index.scss b/docs/.vuepress/styles/index.scss index 6773ab3f4..309ce95b2 100644 --- a/docs/.vuepress/styles/index.scss +++ b/docs/.vuepress/styles/index.scss @@ -42,7 +42,26 @@ h6 { text-align: center; /* Center the text */ } -.vp-description{ + +.version-selector { + appearance: none; /* Removes default browser styling */ + -webkit-appearance: none; /* For Safari */ + -moz-appearance: none; /* For Firefox */ + border: 0px solid #ccc; /* Thin grey border */ + border-radius: 0; /* Removes rounded corners */ + padding: 8px 12px; /* Adds some padding for better usability */ + font-size: 14px; /* Adjusts font size */ + background-color: #fff; /* Flat white background */ + color: #333; /* Text color */ + outline: none; /* Removes focus outline */ + cursor: pointer; /* Changes cursor to pointer */ +} + +.version-selector:focus { + border-color: #888; /* Slightly darker border on focus */ +} + + .vp-description{ text-align: center; max-width: unset; } diff --git a/docs/manual/old-docs.md b/docs/manual/old-docs.md index 6b452d7a7..e43879236 100644 --- a/docs/manual/old-docs.md +++ b/docs/manual/old-docs.md @@ -4,7 +4,7 @@ sidebar: false # Older Documentation Versions - +Select your version here: ## Archives From 159690b37ea410901a53ca2e19ccf3a32c409901 Mon Sep 17 00:00:00 2001 From: Forrest Evans Date: Thu, 12 Dec 2024 14:29:42 -0800 Subject: [PATCH 2/3] Update old-docs.md --- docs/manual/old-docs.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/manual/old-docs.md b/docs/manual/old-docs.md index e43879236..4458c61e4 100644 --- a/docs/manual/old-docs.md +++ b/docs/manual/old-docs.md @@ -4,14 +4,4 @@ sidebar: false # Older Documentation Versions -Select your version here: - -## Archives - -Documentation source for all versions - -[https://github.com/rundeck/docs/tags](https://github.com/rundeck/docs/tags) - -Generated HTML (up to version 3.1.0) - -[https://github.com/rundeck/rundeck-docs/branches/all](https://github.com/rundeck/rundeck-docs/branches/all) +All of our documentation from older versions is available through the dropdown selector above. We do not maintain or update the older versions. From f8ff5b373f155bacf198401227c3b8c30c815a86 Mon Sep 17 00:00:00 2001 From: smartinellibenedetti <139791797+smartinellibenedetti@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:10:32 -0700 Subject: [PATCH 3/3] replace select with a dropdown and add js file with links --- docs/.vuepress/components/CustomNavBar.vue | 18 ++ docs/.vuepress/components/DocVersions.vue | 113 -------- docs/.vuepress/components/navbar.vue | 11 - docs/.vuepress/config.ts | 2 +- .../navbar-menus/previous-versions.js | 262 ++++++++++++++++++ 5 files changed, 281 insertions(+), 125 deletions(-) create mode 100644 docs/.vuepress/components/CustomNavBar.vue delete mode 100644 docs/.vuepress/components/DocVersions.vue delete mode 100644 docs/.vuepress/components/navbar.vue create mode 100644 docs/.vuepress/navbar-menus/previous-versions.js diff --git a/docs/.vuepress/components/CustomNavBar.vue b/docs/.vuepress/components/CustomNavBar.vue new file mode 100644 index 000000000..dff87f397 --- /dev/null +++ b/docs/.vuepress/components/CustomNavBar.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/docs/.vuepress/components/DocVersions.vue b/docs/.vuepress/components/DocVersions.vue deleted file mode 100644 index 3f39f8230..000000000 --- a/docs/.vuepress/components/DocVersions.vue +++ /dev/null @@ -1,113 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/.vuepress/components/navbar.vue b/docs/.vuepress/components/navbar.vue deleted file mode 100644 index bca4591a2..000000000 --- a/docs/.vuepress/components/navbar.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 614f8fd22..13a41f13d 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -294,7 +294,7 @@ export default defineUserConfig({ ), "@theme-hope/modules/navbar/components/Navbar": path.resolve( __dirname, - "./components/DocVersions.vue", + "./components/CustomNavBar.vue", ), }, //Plugins Config diff --git a/docs/.vuepress/navbar-menus/previous-versions.js b/docs/.vuepress/navbar-menus/previous-versions.js new file mode 100644 index 000000000..a05d2513b --- /dev/null +++ b/docs/.vuepress/navbar-menus/previous-versions.js @@ -0,0 +1,262 @@ +export default [ + { + text: 'Version 5.x', + children: [ + { + text: "5.8.0", + link: "https://docs.rundeck.com/5.8.0/" + }, + { + text: "5.7.0", + link: "https://docs.rundeck.com/5.7.0/" + }, + { + text: "5.6.1", + link: "https://docs.rundeck.com/5.6.1/" + }, + { + text: "5.6.0", + link: "https://docs.rundeck.com/5.6.0/" + }, + { + text: "5.5.0", + link: "https://docs.rundeck.com/5.5.0/" + }, + { + text: "5.4.0", + link: "https://docs.rundeck.com/5.4.0/" + }, + { + text: "5.3.0", + link: "https://docs.rundeck.com/5.3.0/" + }, + { + text: "5.2.0", + link: "https://docs.rundeck.com/5.2.0/" + }, + { + text: "5.1.2", + link: "https://docs.rundeck.com/5.1.2/" + }, + { + text: "5.1.1", + link: "https://docs.rundeck.com/5.1.1/" + }, + { + text: "5.1.0", + link: "https://docs.rundeck.com/5.1.0/" + }, + { + text: "5.0.2", + link: "https://docs.rundeck.com/5.0.2/" + }, + { + text: "5.0.1", + link: "https://docs.rundeck.com/5.0.1/" + }, + { + text: "5.0.0", + link: "https://docs.rundeck.com/5.0.0/" + } + ] + }, + { + text: 'Version 4.x', + children: [ + { + text: "4.17.6", + link: "https://docs.rundeck.com/4.17.6/" + }, + { + text: "4.17.5", + link: "https://docs.rundeck.com/4.17.5/" + }, + { + text: "4.17.4", + link: "https://docs.rundeck.com/4.17.4/" + }, + { + text: "4.17.3", + link: "https://docs.rundeck.com/4.17.3/" + }, + { + text: "4.17.2", + link: "https://docs.rundeck.com/4.17.2/" + }, + { + text: "4.17.1", + link: "https://docs.rundeck.com/4.17.1/" + }, + { + text: "4.17.0", + link: "https://docs.rundeck.com/4.17.0/" + }, + { + text: "4.16.0", + link: "https://docs.rundeck.com/4.16.0/" + }, + { + text: "4.15.0", + link: "https://docs.rundeck.com/4.15.0/" + }, + { + text: "4.14.2", + link: "https://docs.rundeck.com/4.14.2/" + }, + { + text: "4.14.1", + link: "https://docs.rundeck.com/4.14.1/" + }, + { + text: "4.14.0", + link: "https://docs.rundeck.com/4.14.0/" + }, + { + text: "4.13.0", + link: "https://docs.rundeck.com/4.13.0/" + }, + { + text: "4.12.1", + link: "https://docs.rundeck.com/4.12.1/" + }, + { + text: "4.12.0", + link: "https://docs.rundeck.com/4.12.0/" + }, + { + text: "4.11.0", + link: "https://docs.rundeck.com/4.11.0/" + }, + { + text: "4.10.2", + link: "https://docs.rundeck.com/4.10.2/" + }, + { + text: "4.10.1", + link: "https://docs.rundeck.com/4.10.1/" + }, + { + text: "4.10.0", + link: "https://docs.rundeck.com/4.10.0/" + }, + { + text: "4.9.0", + link: "https://docs.rundeck.com/4.9.0/" + }, + { + text: "4.8.0", + link: "https://docs.rundeck.com/4.8.0/" + }, + { + text: "4.7.0", + link: "https://docs.rundeck.com/4.7.0/" + }, + { + text: "4.6.1", + link: "https://docs.rundeck.com/4.6.1/" + }, + { + text: "4.5.0", + link: "https://docs.rundeck.com/4.5.0/" + }, + { + text: "4.4.0", + link: "https://docs.rundeck.com/4.4.0/" + }, + { + text: "4.3.0", + link: "https://docs.rundeck.com/4.3.0/" + }, + { + text: "4.2.0", + link: "https://docs.rundeck.com/4.2.0/" + }, + { + text: "4.1.0", + link: "https://docs.rundeck.com/4.1.0/" + }, + { + text: "4.0.0", + link: "https://docs.rundeck.com/4.0.0/" + } + ] + }, + { + text: 'Version 3.x', + children: [ + { + text: "3.4.10", + link: "https://docs.rundeck.com/3.4.10/" + }, + { + text: "3.3.9", + link: "https://docs.rundeck.com/3.3.9/" + }, + { + text: "3.2.9", + link: "https://docs.rundeck.com/3.2.9/" + }, + { + text: "3.1.3", + link: "https://docs.rundeck.com/3.1.3/" + }, + { + text: "3.0.27", + link: "https://docs.rundeck.com/3.0.27/" + } + ] + }, + { + text: 'Version 2.x', + children: [ + { + text: "2.11.14", + link: "https://docs.rundeck.com/2.11.14/" + }, + { + text: "2.10.8", + link: "https://docs.rundeck.com/2.10.8/" + }, + { + text: "2.9.2", + link: "https://docs.rundeck.com/2.9.2/" + }, + { + text: "2.8.4", + link: "https://docs.rundeck.com/2.8.4/" + }, + { + text: "2.7.3", + link: "https://docs.rundeck.com/2.7.3/" + }, + { + text: "2.6.11", + link: "https://docs.rundeck.com/2.6.11/" + }, + { + text: "2.5.3", + link: "https://docs.rundeck.com/2.5.3/" + }, + { + text: "2.4.2", + link: "https://docs.rundeck.com/2.4.2/" + }, + { + text: "2.3.2", + link: "https://docs.rundeck.com/2.3.2/" + }, + { + text: "2.2.3", + link: "https://docs.rundeck.com/2.2.3/" + }, + { + text: "2.1.3", + link: "https://docs.rundeck.com/2.1.3/" + }, + { + text: "2.0.4", + link: "https://docs.rundeck.com/2.0.4/" + } + ] + } +] \ No newline at end of file