Configuration
This theme extends the VuePress2 Default Theme but sets slightly different defaults. Theoretically all the options supported in the default theme should also be available in this one.
Before you get started its HEAVILY RECOMMENDED that you set the following parent config before proceeding. Here is what we set for the repo that generates these docs:
import {defineUserConfig} from '@vuepress/cli';
import {defaultThemePlus} from '@lando/vuepress-theme-default-plus';
export default defineUserConfig({
...
theme: defaultThemePlus({
docsDir: 'docs',
docsBranch: 'main',
repo: 'lando/vuepress-theme-default-plus',
}),
...
});
And here is our special config:
Generic Config
alias
Type:
ObjectDefault:
{}Details:
This allows the user to override any downstream components with their own. See this.
Example:
alias: { '@theme/Home.vue': './Home.vue'), },
baseUrl
Type:
StringDefault:
nullExample:
baseUrl: "https://docs.lando.dev"Details:
This allows external links to the specified
baseUrlto be experentially treated like internal links. This is useful if you have multiple VuePress sites that are all tied together into a single domain experient a la Netlify's rewrite functionality.If you don't understand what that is or you only have a single docs site then its best to just ignore this one.
contributorsExclude
Type:
ArrayDefault:
[]Example:
contributorsExclude: [ 'Mike Pirog', 'dependabot[bot]', ]Details:
This allows you to filter out some contributors from where contributors show up eg
CustomPageMetaandGuideHeader. Note that unlikecontributorsPage.excludethis is NOT NECCESARILY a GitHub username so take care to get the contributor name right.
defaults
Type:
ObjectDefault: Here
Example:
defaults: { ga: { id: 'SOME ID', }, }Details:
This allows you to easily extend this theme with defaults that make more sense for you. This lets you distribute common config to all the things that use it like Google Analytics IDs, shared navbar items, etc.
sharedNavbar
Type:
ArrayDefault:
[]Example:
sharedNavbar: [ {text: 'GitHub2', link: 'https://github.com/lando/vuepress-theme-default-plus/'}, ],Details:
This prepends a bunch of entries to the usual
navbarand follows the same format. It is usually used in combination withbaseUrlto bring its "treat like internal link" functionality to thenavbar. It also is useful if you want to extend this theme deploy a shared navbar
Alert
alert
Type:
Object || BooleanDefault:
falseExample:
alert: { content: 'Are you looking for the 3.x docs? You can go to them <a href="/3.x">here</a>.', scheme: 'neutral', closeable: true, },Details:
This will print an alert at the top of the page. You can pass in HTML content allow "dangerous things" will be stripped.
Setting
closeableto false will persist the alert and not let the user dismiss it.You can set a
schemefor the alert which will append thealert-scheme-SCHEMEclass to the alert container egalert-scheme-success. We have provided the following schemes by default:danger|warning|tip|neutral|success. If you specify a different scheme you will want to make sure to provide thealert-scheme-MYSCHEMEclass.You can also configure the
alertheight with the--alert-heightpallette variable.
Autometa
autometa
Type:
Object || BooleanDefault:
falseExample:
autometa: { twitter: '@devwithlando', canonicalUrl: 'https://vuepress-theme-default-plus.lando.dev/', },Details:
Set this if you care about the theme automatically generating common metatags.
Carbon Ads
carbonAds
Type:
Object || BooleanDefault:
carbonAds: falseExample:
carbonAds: { placement: 'landodev', serve: 'CE7DCKJU', },
Contributors Page
contributorsPage
Type:
Object || BooleanDefault:
contributorsPage: { auto: true, },Full Example:
contributorsPage: { auto: true, repo: 'lando/vuepress-theme-default-plus', content: fs.readFileSync(path.resolve(__dirname, 'contributors.md')), exclude: [ 'dependabot[bot]', ], data: [{ name: 'pirog', img: 'https://me.pic', link: 'pirog.dev', score: 100, }], docsBranch: 'main', docsDir: '', link: '/contributors.html', title: 'Contributorz', },Details:
This will automatically generate a page of contributors based on the
data.If you set
autototrueandrepois a public GitHub repo then the theme will attempt to populate the data for you. However, if you manually set a value then the theme will prefer that. So in the above Full Example the theme will just usedatainstead of what is on GitHub.If you do not set
repo,docsBranchanddocsDirexplicitly the theme will userepo,docsBranch,docsDirinstead.
Jobs
jobs
Type:
Object || BooleanDefault:
jobs: falseExample:
jobs: [ { title: 'Lando Developer', logo: 'https://docs.lando.dev/images/icon.svg', link: 'https://docs.google.com/forms/d/e/1FAIpQLSc2vkesq59BblKo8ZX-R1hKTrHphh1kmsg4FgWV1WH5BKEjHQ/viewform', company: 'Lando System Inc', aux: 'DC, Remote', }, ],
Navbar
navbar
Type:
ObjectDefault:
columns: 3Example:
navbar: [ ... { text: 'Recipes', children: [ { text: 'Hosting Integrations', columns: 2, children: [ { text: 'Acquia', link: 'https://docs.lando.dev/acquia', }, { text: 'Lagoon (beta)', link: 'https://docs.lando.dev/lagoon', alert: 'UPDATED!' }, { text: 'Pantheon', link: 'https://docs.lando.dev/pantheon', }, { text: 'Platform.sh (beta)', link: 'https://docs.lando.dev/platformsh', alert: { text: 'DEPRECATED!', type: 'danger', expires: 4125485593000, }, }, ], }, { text: 'PHP Frameworks', children: [ { text: 'Backdrop', link: 'https://docs.lando.dev/backdrop', }, ], }, ... }, ]Details:
Note that
columnscurrently only works with "subitems" eg children that are expressed in "sections" as in the example above.You can add the optional
alertto any child item. This will add a stylized and expiring badge before the link with text of your choosing. If you makealertastringit will use that as the badge text. If you makealertanobjectyou can also customize the style and the expiration date of the alert.alertcan be styled with settingalert.typeto one ofnew,updated,deprecatedoreol. You can automatically remove the alert at given time by settingalert.expireswhich must be expressed as a timestamp in milliseconds.If a top level menu item contains any children with
alertsof typenewthen an alert circle will appear in front of that menu item as a circle colored with the theme's primary color.
Page Types
pageTypes
Type:
Array || BooleanDefault:
pageTypes: [{ name: 'Guide', key: 'guide', path: path.resolve(__dirname, '..', 'components', 'Guide.vue'), }, { name: 'Blog', key: 'blog', path: path.resolve(__dirname, '..', 'components', 'BlogPost.vue'), }],Details:
pageTypeallows you to easily add additional "custom page components". You can then use those page components by setting thekeyof any of the types totruein your frontmatter.More concretely and using the example above, which is the default, you can set
blog: trueorguide: truein your frontmatter to use either theGuideorBlogPostcomponents instead of the defaultPagecomponent.
Reading Mode
readMode
Type:
Object || BooleanDefault:
trueExample:
readMode: { focusName: 'MAKE READING EASIER', distractName: 'MAKE READING HARDER', },Details:
Configure the way "Reading Mode" is set up or disable it completely with
false.
Robots.txt
Robots.txt
Type:
ObjectDefault:
robots: { allowAll: true, },Example:
robots: { host: 'https://vuepress-theme-default-plus.lando.dev/', sitemap: 'https://vuepress-theme-default-plus.lando.dev/sitemap.xml, disallowAll: false, allowAll: false, policies: [ { userAgent: '*', disallow: [ '/user/', '/login' ], allow: [ '*.js', '*.png' ] } ] },Details:
If disallowAll is set to true, it will ignore all other options and exclude everything on the site from indexing. allowAll is set to true by default and this ignores the policies option.
To use the policies option, make sure both disallowAll and allowAll are set to false.
You can specify host and sitemap directly. If you omit them the theme will attempt to set them if it can and it makes sense.
Search
search
Type:
Object || BooleanDefault:
search: falseExample:
Docsearchsearch: { appId: 'BH4D9OD16A', apiKey: '15e332feefe9ec96929f44c62f6c88', indexName: 'lando', searchBase: 'https://docs.lando.dev', },default searchsearch: trueDetails:
Set to true to turn on the default search functionality. If you wish to leverage Docsearch then you also need to pass in an appId, apiKeyandindexName`.
Note that if you want to search across many sites that operate under a single domain then you will also need to set the searchBase. If you have not set searchBase it will use baseUrl instead.
Sidebar Header
sidebarHeader
Type:
Object || BooleanDefault:
falseFull Example:
sidebarHeader: { auto: true, repo: 'lando/vuepress-theme-default-plus', icon: './icon.png', title: 'Current Version', version: null, link: null, satisifies: undefined, type: 'tip', }Details:
sidebarHeaderallows you to give greater context and organization around the secondary sidebar menu. This is particularly useful if you have a single site that combines the docs of many projects together.If you set
autototrueandrepois a public GitHub repo then the theme will attempt to populate the other values for you. However, if you manually set a value then the theme will prefer that. So in the above Full Example the theme will setversionandlinkautomatically but will useCurrent Versionfor the title.If you are using
autoyou can also specifysatisfieswhich is a semver comparision string. This will use the first entry from the resulting subset of releases. Note that this also assumes thenameof your GitHub release is a semver compatible string.You can specify
typeand it will wrap the version badge inbadge TYPE. By default it isbadge tip. If you modify this you will need to define thebadge TYPEstyle eg if you settype: hotthen you will need to definebadge hotin CSS.If you do not set
repoexplicitly the theme will try to userepoinstead.iconis optional and puts the specificed icon to the left of the title.
Sitemap.xml
Sitemap.xml
Type:
ObjectDefault:
sitemap: trueExample:
sitemap: { baseUrl: 'https://stuffandthings.com', changefreq: 'daily', priority: 0.5, urls: [ 'stuff.html', 'things.html, ], exclude: [ 'badstuff.html' ], },Details:
If the baseUrl above is not specified then the theme will try to use autometa.canonicalurl and then the generic.baseUrl. You can also globally set the changefreq and priority for all pages that do not have them defined in their frontmatter.
You can also add additional urls that may not get picked up in the pages object via urls. You can also choose to exclude certain urls via the exclude option array as well.
- Frontmatter
You can override the global config for the following options via the frontmatter of any page:
---
sitemap:
exclude: false
changefreq: hourly
priority: 1.0
---
Social
social
Type:
Object || BooleanDefault:
social: falseExample:
social: { enabled: true, owner: '@devwithlando', icons: [{ title: 'Twitter', svg: { attributes: { 'viewBox': '0 0 24 24', 'fill': 'none', 'stroke-width': 2, 'stroke-linecap': 'round', 'stroke-linejoin': 'round', }, path: { d: 'M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z', }, }, link: 'https://twitter.com/devwithlando', }, },
Sponsors
sponsors
Type:
Object || BooleanDefault:
sponsors: falseExample:
sponsors: { text: 'your logo?', link: 'https://lando.dev/sponsor', data: [ { name: 'Pantheon', id: 'pantheon', url: 'https://pantheon.io/', logo: 'https://www.drupal.org/files/Pantheon_logo_black_0.png', type: 'full' }, ], },
Tagging
tags
Type:
BooleanDefault:
trueDetails:
Tagging is currently not very configurable but you can disable it by setting
tags: false.
Tracking
ga
Type:
Object || BooleanDefault:
falseExample:
ga: { id: null, }Details:
Set if you want to hookup Google Tag stuff.
idneeds to be a Measurement ID eg formatG-XXXXXXXXXX.
hubspot
Type:
Object || BooleanDefault:
falseExample:
hubspot: { id: null, }Details:
Set if you want to hookup Hubspot tracking codes.
idneeds to be theidin//js.hs-scripts.com/${ID}.js.
Versions Page
versionsPage
Type:
Object || BooleanDefault:
versionsPage: { auto: true, trimLatest: true, satisfies: null, showEdge: true, },Full Example:
versionsPage: { auto: true, repo: 'lando/vuepress-theme-default-plus', content: fs.readFileSync(path.resolve(__dirname, 'versions.md')), data: [{ name: '3.1.4', href: `https://github.com/pi/pi/tree/3.1.4`, target: '_blank', rel: 'noopener noreferrer', }], docsBranch: 'main', docsDir: '', link: '/versions.html', satisfies: '>0.9', showEdge: false, title: 'Previous Versions', trimLatest: true, },Details:
This will automatically generate a page of previous versions based on the
data.If you set
autototrueandrepois a public GitHub repo then the theme will attempt to populate the data for you. However, if you manually set a value then the theme will prefer that. So in the above Full Example the theme will just usedatainstead of what is on GitHub.If you do not set
repo,docsBranchanddocsDirexplicitly the theme will userepo,docsBranch,docsDirinstead.trimLatestwill pop off the most recent version.showEdgecan be either a URL ortrue.You can also specify
satisfieswhich is a semver comparision string. This will only show the satisfied subset ofdata.nameversions.




