diff --git a/docs/package.json b/docs/package.json
index 71458cb50a..b981b27a28 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -1,8 +1,8 @@
{
"devDependencies": {
- "markdown-it": "^14.0.0",
+ "markdown-it": "^14.1.0",
"markdown-it-mathjax3": "^4.3.2",
- "vitepress": "^1.0.0-rc.43",
+ "vitepress": "^1.5.0",
"vitepress-plugin-tabs": "^0.5.0",
"vitest": "^1.3.0"
},
diff --git a/docs/src/.vitepress/config.mts b/docs/src/.vitepress/config.mts
index e4c0427b9c..07308fc9f8 100644
--- a/docs/src/.vitepress/config.mts
+++ b/docs/src/.vitepress/config.mts
@@ -3,6 +3,27 @@ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import mathjax3 from "markdown-it-mathjax3";
import footnote from "markdown-it-footnote";
+function getBaseRepository(base: string): string {
+ if (!base || base === '/') return '/';
+ const parts = base.split('/').filter(Boolean);
+ return parts.length > 0 ? `/${parts[0]}/` : '/';
+}
+
+const baseTemp = {
+ base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
+}
+
+const navTemp = {
+ nav: 'REPLACE_ME_DOCUMENTER_VITEPRESS',
+}
+
+const nav = [
+ ...navTemp.nav,
+ {
+ component: 'VersionPicker'
+ }
+]
+
// https://vitepress.dev/reference/site-config
export default defineConfig({
base: 'REPLACE_ME_DOCUMENTER_VITEPRESS',// TODO: replace this in makedocs!
@@ -11,7 +32,13 @@ export default defineConfig({
lastUpdated: true,
cleanUrls: true,
outDir: 'REPLACE_ME_DOCUMENTER_VITEPRESS', // This is required for MarkdownVitepress to work correctly...
- head: [['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }]],
+ head: [
+ ['link', { rel: 'icon', href: 'REPLACE_ME_DOCUMENTER_VITEPRESS_FAVICON' }],
+ ['script', {src: `${getBaseRepository(baseTemp.base)}versions.js`}],
+ // ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
+ ['script', {src: `${baseTemp.base}siteinfo.js`}]
+ ],
+
ignoreDeadLinks: true,
appearance: 'dark',
@@ -42,10 +69,7 @@ export default defineConfig({
{ text: 'Tutorials', link: '/tutorials/' },
{ text: 'How-to Guides', link: '/howto/' },
{
- text: 'Versions', items: [
- { text: 'Stable', link: 'https://thofma.com/Hecke.jl/stable/' },
- { text: 'Dev', link: 'https://thofma.com/Hecke.jl/dev/' }
- ]
+ component: 'VersionPicker'
}
],
sidebar: {
diff --git a/docs/src/.vitepress/theme/index.ts b/docs/src/.vitepress/theme/index.ts
index 463b5d858c..4a01ff7554 100644
--- a/docs/src/.vitepress/theme/index.ts
+++ b/docs/src/.vitepress/theme/index.ts
@@ -2,6 +2,7 @@
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
+import VersionPicker from "../../components/VersionPicker.vue"
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
import './style.css'
@@ -10,10 +11,12 @@ export default {
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
- // https://vitepress.dev/guide/extending-default-theme#layout-slots
+ // 'home-hero-info-after': () => h(HomeTrustees),
+ 'aside-ads-before': () => h(AsideTrustees),
})
},
enhanceApp({ app, router, siteData }) {
- enhanceAppWithTabs(app)
+ enhanceAppWithTabs(app);
+ app.component('VersionPicker', VersionPicker);
}
-} satisfies Theme
\ No newline at end of file
+} satisfies Theme
diff --git a/docs/src/components/VersionPicker.vue b/docs/src/components/VersionPicker.vue
new file mode 100644
index 0000000000..d0f8f65e10
--- /dev/null
+++ b/docs/src/components/VersionPicker.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+