-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Feature request
What problem does this feature solve?
I was browsing the vue-router docs, and wanted to jump to the vuex docs. Currently there is no "easy" way to do this, and what I would consider a convenient solution is if the current site title was a dropdown with a list of related sites.
What does the proposed API look like?
// .vuepress/config.js
module.exports = {
themeConfig: {
sites: [
{ text: 'Vue Router', link: 'https://router.vuejs.org' },
{ text: 'Vuex', link: 'https://vuex.vuejs.org' },
]
}
}
How should this be implemented in your opinion?
I believe we can easily implement this by reusing the existing DropdownLink
component
And a new branch in the Navbar
component
vuepress/lib/default-theme/Navbar.vue
Lines 15 to 20 in a7d9a1a
<span | |
ref="siteName" | |
class="site-name" | |
v-if="$siteTitle" | |
:class="{ 'can-hide': $site.themeConfig.logo }" | |
>{{ $siteTitle }}</span> |
<!-- sitesLinks would be a computed property so that it can automatically add $siteTitle as the root elements text -->
<DropdownLink v-if="sites" :item="sitesLinks" />
<span
ref="siteName"
class="site-name"
v-else-if="$siteTitle"
:class="{ 'can-hide': $site.themeConfig.logo }"
>{{ $siteTitle }}</span>
Are you willing to work on this yourself?**
If this is something useful for anyone, sure!
Metadata
Metadata
Assignees
Labels
No labels