Theme configuration
link()
#
A standard link for your navigation items. You can also nest links.
Example#
export default defineTheme({
directories: [
directory("dir-a", {
sidebar: [
link("Home", "/home"),
link.nested("Guides", [
link("Guide A", "/guides/a"),
link("Guide B", "/guides/b"),
]),
]
})
],
})
Reference - Link parameters#
function link(title, to, options);
titlestringrequired
The title of the link.
tostringrequired
Where the link goes to. For example: /docs/guides/guide-a
.
optionsExtraLinkOptions
Extra options for this link. All fields are optional.
Reference - link options#
function link(options);
optionsExtraLinkOptions
The options for this link.
Reference - nested link parameters#
function link.nested(title, to, items);
titlestringrequired
The title of the link.
tostringrequired
Where the link goes to. For example: /docs/guides/guide-a
.
itemsArray<LinkComponent | SeparatorComponent>required
The child items of the nested link.
Reference - nested link parameters without link#
function link.nested(title, items);
titlestringrequired
The title of the link.
itemsArray<LinkComponent | SeparatorComponent>required
The child items of the nested link.
Reference - nested link options#
function link.nested(options);
optionsNestedLinkOptions
The options for this nested link.