-
-
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.
simplify sidebarender changes and make them more universal (#64)
* simplify sidebarender changes and make them more universal * simplify sidebarender changes and make them more universal part 2
- Loading branch information
Showing
9 changed files
with
37 additions
and
337 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,19 +1,14 @@ | ||
import {useData} from 'vitepress'; | ||
import {default as normalize} from './normalize-2base.js'; | ||
import {default as normalizeMvb} from './normalize-mvblink.js'; | ||
import {default as normalizeRoot} from './normalize-rootlink.js'; | ||
|
||
export default function getItemNormalizedLink(item) { | ||
// if we dont have what we need just return that garbage | ||
if (!item.link) return item.link; | ||
|
||
const {site} = useData(); | ||
const base = site?.value?.base ?? '/'; | ||
|
||
// handle special rels | ||
if (item.rel === 'mvb') return normalizeMvb(item.link); | ||
else if (item.rel === 'root') return normalizeRoot(item.link); | ||
// if this is not a special mvb then just return | ||
if (item.rel !== 'mvb') return item.link; | ||
|
||
// and this is everythign else | ||
return normalize(item.link, base); | ||
// otherwise normalize on version base | ||
const {site} = useData(); | ||
return normalize(item.link, site?.value?.themeConfig?.multiVersionBuild?.base ?? '/'); | ||
}; |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.