-
Notifications
You must be signed in to change notification settings - Fork 11
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
test versioning #38
test versioning #38
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { ref, onMounted } from 'vue' | ||
export const versions = [ | ||
{text: 'stable', link: '/',}, | ||
{text: 'dev', link: '/dev/',}, | ||
{text: 'v0.0.3', link: '/v.0.0.3/'} | ||
] | ||
|
||
// shared data across instances so we load only once. | ||
// const versions = ref([]) | ||
|
||
// const dataHost = 'https://github.com/LuxDL/DocumenterVitepress.jl/blob/gh-pages/' | ||
// const dataUrl = `${dataHost}/versions.js` | ||
Comment on lines
+11
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we use this instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This way it's synced with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😄 , how? the issue is getting that list automatically? maybe from the Julia side then, read, parse and include? no idea. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could get the list by e.g.: const dataHost = 'https://luxdl.github.io/DocumenterVitepress.jl'
const dataUrl = `${dataHost}/versions.js` see e.g. https://luxdl.github.io/DocumenterVitepress.jl/versions.js but I'm not sure how the list would be constructed - or how it should be structured! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the template:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just remembered that I once added some version support for the mkdocs build (via mike), where I hooked into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That could work as a first pass. My issue with it is that it creates a static version selector, meaning that people on docs of v0.4 could not access v0.6 through the selector. If possible, the best thing to do is probably to somehow access |
||
|
||
// export function useSponsor() { | ||
// onMounted(async () => { | ||
// if (versions.value) { | ||
// return | ||
// } | ||
|
||
// const result = await fetch(dataUrl) // Access-Control-Allow-Origin error | ||
// // const json = await result.json() // as text instead | ||
|
||
// // versions.value = | ||
// }) | ||
// return { | ||
// versions, | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then we add the current version (be it dev, preview, or v*) to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm... note that the
items
part is the thing that needs to be replaced.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you had some code in the component to make items dynamic?