-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first pass on theme composables, data, etc for multi version build stuff
- Loading branch information
Showing
11 changed files
with
151 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
import {data as tags} from './tags.data.js'; | ||
|
||
import {useData} from 'vitepress'; | ||
|
||
export default function useTags() { | ||
return tags; | ||
// get version path data | ||
const {theme} = useData(); | ||
const vp = theme?.value?.multiVersionBuild?.path ?? '/v/'; | ||
|
||
// generate links we can pass into VPLVersionLink | ||
const links = tags.versions | ||
.map(version => ({ | ||
text: version, | ||
href: `${vp}${version}/`, | ||
prerelease: /^v?\d+\.\d+\.\d+-\S+$/.test(version), | ||
stable: tags?.aliases?.stable === version, | ||
edge: tags?.aliases?.edge === version, | ||
})); | ||
|
||
return {...tags, links}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,4 +95,3 @@ watch(() => page.value.relativePath, () => { | |
padding: 16px 0 ; | ||
} | ||
</style> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
--- | ||
description: Learn how to install and get started with VitePress Default Theme Plus! | ||
description: All Other documentation versions | ||
title: Docuversions | ||
contributors: false | ||
lastUpdated: false | ||
editLink: false | ||
next: false | ||
--- | ||
|
||
# Usage | ||
|
||
Before starting make sure you are familiar with [the basics](https://vitepress.dev/guide/getting-started#file-structure) of VitePress theme installation. | ||
|
||
To start using the theme you will want to create `.vitepress/theme/index.mjs` and `.vitepress/config.mjs` as below: | ||
|
||
## .vitepress/theme/index.mjs | ||
|
||
```js | ||
import {VPLTheme} from '@lando/vitepress-theme-default-plus'; | ||
export default VPLTheme; | ||
``` | ||
|
||
If you want to extend our theme you should consult the [official docs](https://vitepress.dev/guide/extending-default-theme) on how to best do that. | ||
|
||
## .vitepress/config.mjs | ||
|
||
Import our `defineConfig` wrapper and pass in hte [configuration](./../config/config) you want. | ||
|
||
```js | ||
import {defineConfig} from '@lando/vitepress-theme-default-plus/config'; | ||
|
||
export default defineConfig({ | ||
title: 'VitePress Theme +', | ||
description: 'The VitePress default theme with some MOARPOWAH!', | ||
base: '/', | ||
lang: 'en-US', | ||
themeConfig: { | ||
... | ||
}, | ||
... | ||
}); | ||
``` | ||
# Docuversions | ||
|
||
<br /> | ||
<br /> | ||
|
||
<div | ||
v-for="link in links" | ||
:key="link.text" | ||
class="version-link" | ||
> | ||
<VPLVersionLink | ||
:text="link.text" | ||
:href="link.href" | ||
:prerelease="link.prerelease" | ||
:stable="link.stable" | ||
:edge="link.edge" | ||
/> | ||
</div> | ||
|
||
<br /> | ||
|
||
<div> | ||
<VPLVersionLink :dev="true" :text="aliases.dev" href="/v/dev/" /> | ||
</div> | ||
|
||
<script setup> | ||
import {useTags} from '@lando/vitepress-theme-default-plus'; | ||
import {VPLCollectionPage, VPLCollectionPageSection, VPLCollectionPageTitle, VPLVersionLink} from '@lando/vitepress-theme-default-plus'; | ||
|
||
const {aliases, links} = useTags(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters