Theme Layout Options
The following options control theme layout.
Navbar Related
NavbarOptions | falsefalseNavbar config.
See also: Layout → Navbar → Navbar links and Layout → Navbar → Disable Navbar.
NavbarLayoutOptions{ start: ["Brand"], center: ["Links"], end: ["Language", "Repo", "Outlook", "Search"] }Customize navbar layout.
See also: Layout → Navbar → Navbar layout.
Each field accepts an array of built-in navbar component names or custom component names:
type NavbarComponent =
"Brand" | "Links" | "Language" | "Search" | "Outlook" | "Repo";(NavbarComponent | string)[]The navbar components at the start.
(NavbarComponent | string)[]The navbar components in the center.
(NavbarComponent | string)[]The navbar components at the end.
stringNavbar logo, should be absolute path relative to .vuepress/public folder.
See also: Layout → Navbar → Site Logo.
stringlogoNavbar logo in dark mode, should be absolute path relative to .vuepress/public folder.
See also: Layout → Navbar → Site Logo.
string$siteLocale.titleNavbar title, you can set it to an empty string to hide it.
stringRepository link.
booleantrueWhether display repo link in navbar.
stringRepository aria label of navbar.
Note
The theme can recognize links of GitHub, Gitlab, Gitee and Bitbucket.
'always' | 'mobile' | 'none''mobile'Whether to hide navbar when scrolling down.
booleantrueWhether hide site title on mobile.
Sidebar Related
For guide, see Layout → Sidebar.
SidebarOptions'structure'Sidebar Config.
SidebarSorter["readme", "order", "title", "filename"]Structure sidebar sorter.
You can:
- fill in a custom function
- provide one sorter keyword
- provide an array of custom function or sorter keyword
Available keywords are:
readme:README.mdorreadme.mdfirstorder: positive order first with its value ascending, negative order last with its value descendingdate: sort by date ascendingdate-desc: sort by date descendingtitle: alphabetically sort by titlefilename: alphabetically sort by filename
Its type is:
import type {
ThemeNormalPageFrontmatter,
ThemePageData,
} from "vuepress-theme-hope";
interface SidebarFileInfo {
type: "file";
filename: string;
title: string;
order: number | null;
path?: string | null;
frontmatter: ThemeNormalPageFrontmatter;
pageData: ThemePageData;
}
interface SidebarDirInfo {
type: "dir";
dirname: string;
children: SidebarInfo[];
title: string;
order: number | null;
groupInfo: {
icon?: string;
collapsible?: boolean;
link?: string;
};
frontmatter: ThemeNormalPageFrontmatter | null;
pageData: ThemePageData | null;
}
type SidebarInfo = SidebarFileInfo | SidebarDirInfo;
type SidebarSorterKeyword =
"readme" | "order" | "date" | "date-desc" | "filename" | "title";
type SidebarSorterFunction = (infoA: SidebarInfo, infoB: SidebarInfo) => number;
type SidebarSorter =
| SidebarSorterFunction
| SidebarSorterKeyword
| (SidebarSorterKeyword | SidebarSorterFunction)[];Route Navigation
booleantrueWhether enable route navigation globally.
booleantrueWhether show icons in route navigation.
booleantrueWhether show prevLink in bottom.
booleantrueWhether show nextLink in bottom.
Page Meta
booleantrueWhether to display an icon beside the page title.
ArticleInfo[] | false["Author", "Original", "Date", "Category", "Tag", "ReadingTime"]Article information. The order of the items decides the display order. Fill in false to disable it.
Available items in ArticleInfo:
'Author': author'Date': writing date'Original': is original'Category': category'Tag': tags'ReadingTime': expect reading time'Word': word number for the article'PageView': pageviews
booleantrueWhether to show "Last Updated" or not.
'content' | 'meta' | boolean'meta'Whether to show "Contributors" or not.
'content': show as content in main text'meta': show as meta info at the bottom of contenttrue: same as'meta'false: disable it
booleanWhether to show changelog.
booleantrueWhether to show "Edit this page" or not.
stringPattern of edit link. While :repo :branch :path will be automatically replaced by docsRepo docsBranch and docsDir + filePath.
Note
The theme provides built-in support for GitHub, Gitlab, Gitee and Bitbucket.
stringrepoThe repo of your docs.
string'main'The branch of your docs.
stringDocs dir location in repo.
Footer
stringThe default content for the footer, can accept HTMLString.
string | false'Copyright © <author>'The default copyright info, set it to false to disable it by default.
booleanWhether to display footer by default.
Others
stringHome path of current locale, used as the link of back-to-home and navbar logo.
booleanWhether to use RTL layout.
GetHeadersOptions | booleantrueWhether show toc list.
false: No headers.number: only headings of that level will be displayed.[number, number]: headings level tuple, where the first number should be less than the second number, for example,[2, 4]which means all headings from<h2>to<h4>will be displayed.'deep': same as[2, 6], which means all headings from<h2>to<h6>will be displayed.
string'#markdown-content > h1, #markdown-content > h2, #markdown-content > h3, #markdown-content > h4, #markdown-content > h5, #markdown-content > h6, [vp-content] > h2'The selector of the headers.
string[][".vp-badge", ".vp-icon"]Ignore specific elements within the header, should be an array of CSS Selector.
HeaderLevels'deep'The levels of the headers.
1 to 6 for <h1> to <h6>
Changelog
0c1aa-ondd81e-on9a4c3-on9a31c-one12a3-on9a004-on12a7b-on9f5ef-on1e314-on76d91-on4a9b3-onf91f0-onb1230-ond58b6-on73f6e-on41639-ona8a07-ond8aeb-on794f9-ondc56d-onc2ba2-on2a306-on04f3a-one9f26-on13ace-on78b3c-on11463-onedf2d-on8174c-onaafa6-on6f20f-on5a6f8-onb81ad-on9df60-on5f9be-on7d314-on2243a-on3e996-on3d007-on636cc-on9856d-onad023-onf852c-ondb823-onaae8c-on35972-onfd395-on1eb77-onbcf02-onde367-on2e966-on3f0c3-one2478-onbabc9-on0c093-onf6ff0-on6c43f-on892cc-on3c199-on