├── .bun-version ├── .node-version ├── .eslintignore ├── .npmignore ├── docs ├── public │ ├── favicon.ico │ ├── lando │ │ ├── icon.png │ │ ├── logo.png │ │ ├── favicon.ico │ │ ├── favicon.svg │ │ ├── icon.svg │ │ └── logo.svg │ ├── images │ │ ├── hero.png │ │ ├── favicon.png │ │ ├── features.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── apple-touch-icon.png │ │ ├── vitepress-lando-logo.png │ │ ├── vitepress-lando-logo.webp │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── vitepress-lando-logo-icon.png │ │ └── vitepress-lando-logo-mini.png │ └── form.html ├── .vitepress │ └── theme │ │ └── index.js ├── pages │ ├── url-loader.md │ ├── teams.md │ └── collections.md ├── cats.md ├── markdown │ ├── highlights.md │ ├── cards.md │ ├── thumbnails.md │ ├── boxes.md │ ├── admonitions.md │ ├── columns.md │ └── tabs.md ├── components │ ├── youtube.md │ ├── jobs.md │ ├── mailchimp.md │ └── sponsors.md ├── team.md ├── support.md ├── config │ └── create-content-loader.md ├── guides.md ├── blog.md ├── composables │ ├── use-collection.md │ ├── use-tags.md │ └── use-team.md ├── v │ └── index.md ├── install.md ├── guides │ ├── making-a-guide.md │ ├── adding-remote-content.md │ ├── guide-signup.md │ ├── making-a-guide-2.md │ ├── adding-page-metadata.md │ ├── tagging-shit.md │ └── advanced-markdown.md ├── usage.md ├── development.md ├── all.md ├── index.md ├── blog │ ├── making-a-blog-post-2.md │ └── making-a-blog-post.md └── build │ └── multiversion-vitepress-build.md ├── client ├── use-team.js ├── enhance-app-with-layouts.js ├── tags.data.js ├── collections.data.js ├── team.data.js ├── use-tags.js └── use-collection.js ├── utils ├── encode-tag.js ├── normalize-rootlink.js ├── resolve-git-paths.js ├── detect-runtime.js ├── normalize-mvblink.js ├── parse-stdout.js ├── normalize-items.js ├── get-ga-headers.js ├── traverse-up.js ├── is-faux-internal.js ├── get-item-nl.js ├── parse-layouts.js ├── get-hubspot-headers.js ├── merge-promise.js ├── is-active.js ├── normalize-mvb.js ├── is-dev-release.js ├── get-timestamp.js ├── get-base-url.js ├── create-container.js ├── get-branch.js ├── create-exec.js ├── normalize-2base.js ├── get-tags.js └── create-content-loader.js ├── .github ├── FUNDING.yml └── workflows │ ├── pr-linter.yml │ └── pr-tests.yml ├── .editorconfig ├── .lando.yml ├── vite ├── patch-vp-menu-columns-plugin.js ├── add-layout-components-plugin.js ├── patch-vp-use-sidebar-control.js └── url-loader.js ├── .eslintrc.json ├── node ├── build-collections.js ├── augment-authors.js ├── normalize-legacy-frontmatter.js ├── add-contributors.js ├── parse-collections.js ├── generate-robots.js ├── add-metadata.js ├── normalize-frontmatter.js └── generate-feeds.js ├── markdown ├── tabs-override-plugin.js └── link-override-plugin.js ├── LICENSE ├── components ├── VPLYouTube.vue ├── VPLCollectionPageTags.vue ├── VPLCollectionPageTitle.vue ├── VPLCollectionPage.vue ├── VPLCollectionIcon.vue ├── VPLDogs.vue ├── VPLCollectionPageSection.vue ├── VPLCollectionTag.vue ├── VPLCollectionItemTags.vue ├── VPLDocFooterLastUpdated.vue ├── VPLCats.vue ├── VPLMenuLink.vue ├── VPLVersionLink.vue ├── VPLLink.vue ├── VPLAlgoliaSearchBox.vue ├── VPLJobs.vue ├── VPLCollectionHeader.vue ├── VPLMenuGroup.vue ├── VPLLayout.vue ├── VPLPostHeader.vue ├── VPLNavBarMenuGroup.vue ├── VPLCollectionItems.vue ├── VPLAlert.vue ├── VPLTeamMembers.vue ├── VPLMailChimp.vue └── VPLCollectionItem.vue ├── netlify.toml ├── .gitignore ├── README.md ├── package.json ├── vitepress-theme-default-plus.js └── config └── defaults.js /.bun-version: -------------------------------------------------------------------------------- 1 | 1.2.15 2 | -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | temp 2 | cache 3 | dist 4 | _site 5 | !.vitepress 6 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github 2 | docs 3 | examples 4 | guides 5 | test 6 | -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/favicon.ico -------------------------------------------------------------------------------- /docs/public/lando/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/lando/icon.png -------------------------------------------------------------------------------- /docs/public/lando/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/lando/logo.png -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | import VPLTheme from '@lando/vitepress-theme-default-plus'; 2 | 3 | export default VPLTheme; 4 | -------------------------------------------------------------------------------- /docs/public/images/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/hero.png -------------------------------------------------------------------------------- /docs/public/lando/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/lando/favicon.ico -------------------------------------------------------------------------------- /docs/public/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/favicon.png -------------------------------------------------------------------------------- /docs/public/images/features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/features.png -------------------------------------------------------------------------------- /client/use-team.js: -------------------------------------------------------------------------------- 1 | import {data as team} from './team.data.js'; 2 | 3 | export default function useTeam() { 4 | return team; 5 | } 6 | -------------------------------------------------------------------------------- /docs/pages/url-loader.md: -------------------------------------------------------------------------------- 1 | --- 2 | url-loader: https://raw.githubusercontent.com/lando/setup-lando/refs/heads/main/docs/windows.md 3 | --- 4 | -------------------------------------------------------------------------------- /docs/public/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/favicon-16x16.png -------------------------------------------------------------------------------- /docs/public/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/favicon-32x32.png -------------------------------------------------------------------------------- /docs/public/images/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/public/images/vitepress-lando-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/vitepress-lando-logo.png -------------------------------------------------------------------------------- /docs/public/images/vitepress-lando-logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/vitepress-lando-logo.webp -------------------------------------------------------------------------------- /docs/public/images/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/public/images/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/public/images/vitepress-lando-logo-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/vitepress-lando-logo-icon.png -------------------------------------------------------------------------------- /docs/public/images/vitepress-lando-logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lando/vitepress-theme-default-plus/HEAD/docs/public/images/vitepress-lando-logo-mini.png -------------------------------------------------------------------------------- /utils/encode-tag.js: -------------------------------------------------------------------------------- 1 | 2 | export default function encodeTag(data) { 3 | if (typeof data !== 'string') return ''; 4 | return data.replaceAll(' ', '-').toLowerCase(); 5 | }; 6 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [lando, pirog] 4 | patreon: devwithlando 5 | open_collective: devwithlando 6 | custom: https://lando.dev/join 7 | -------------------------------------------------------------------------------- /utils/normalize-rootlink.js: -------------------------------------------------------------------------------- 1 | import {default as normalize} from './normalize-2base.js'; 2 | 3 | export default function normalizerootLink(url, site) { 4 | return normalize(url, '/', site); 5 | }; 6 | -------------------------------------------------------------------------------- /utils/resolve-git-paths.js: -------------------------------------------------------------------------------- 1 | import {join} from 'node:path'; 2 | 3 | export default function(page, base, extras = []) { 4 | return [page, ...extras.map(item => join(page, '..', item))].map(page => join(base, page)); 5 | }; 6 | -------------------------------------------------------------------------------- /utils/detect-runtime.js: -------------------------------------------------------------------------------- 1 | 2 | export default function detectRuntime() { 3 | // bun 4 | if (typeof Bun !== 'undefined' || process.versions.bun) { 5 | return 'bun'; 6 | 7 | // node 8 | } else return 'node'; 9 | }; 10 | -------------------------------------------------------------------------------- /client/enhance-app-with-layouts.js: -------------------------------------------------------------------------------- 1 | // DO NOT MODIFY THIS FILE!!! 2 | // if you do it or you will break things 3 | // it is automatically transformed by vite to statically include our layout imports 4 | export default function(app) { 5 | }; 6 | -------------------------------------------------------------------------------- /utils/normalize-mvblink.js: -------------------------------------------------------------------------------- 1 | import {default as normalize} from './normalize-2base.js'; 2 | 3 | export default function normalizemvbLink(url, site) { 4 | return normalize(url, site?.themeConfig?.multiVersionBuild?.mvbase ?? '/', site); 5 | }; 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | charset = utf-8 9 | 10 | [*.js] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /utils/parse-stdout.js: -------------------------------------------------------------------------------- 1 | import {execSync} from 'node:child_process'; 2 | 3 | export default function(cmd, options = {}) { 4 | const stdout = execSync(cmd, {maxBuffer: 1024 * 1024 * 10, encoding: 'utf-8', ...options}); 5 | return options.trim === true ? stdout.trim() : stdout; 6 | }; 7 | -------------------------------------------------------------------------------- /utils/normalize-items.js: -------------------------------------------------------------------------------- 1 | import {default as getItemNormalizedLink} from './get-item-nl.js'; 2 | 3 | export default function normalizeItems(items, site) { 4 | return items.map(item => { 5 | if (item.items && Array.isArray(item.items)) return normalizeItems(item.items, site); 6 | else if (item.rel !== 'mvb') return item; 7 | else return {...item, link: getItemNormalizedLink(item, site)}; 8 | }); 9 | }; 10 | -------------------------------------------------------------------------------- /docs/cats.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about cats! 3 | layout: cats 4 | --- 5 | 6 | # Cats 7 | 8 | This is a layout that fills slots with cats. 9 | 10 | This really sets the mood for the below list of cat based music videos. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /utils/get-ga-headers.js: -------------------------------------------------------------------------------- 1 | export default function(id) { 2 | return [ 3 | ['script', {async: true, src: `https://www.googletagmanager.com/gtag/js?id=${id}`}], 4 | ['script', {}, [ 5 | 'window.dataLayer = window.dataLayer || [];', 6 | 'function gtag(){dataLayer.push(arguments);}', 7 | `gtag('js', new Date());`, 8 | `gtag('config', '${id}');`, 9 | ].join('\n'), 10 | ], 11 | ]; 12 | }; 13 | -------------------------------------------------------------------------------- /docs/markdown/highlights.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about custom highlight markdown containers in VitePress Default Theme + 3 | --- 4 | 5 | # Highlight Containers 6 | 7 | ::: highlight 8 | What if I told you that the Republic was now under the control of a Dark Lord of the Sith? 9 | ::: 10 | 11 | ```md 12 | ::: highlight 13 | What if I told you that the Republic was now under the control of a Dark Lord of the Sith? 14 | ::: 15 | ``` 16 | -------------------------------------------------------------------------------- /utils/traverse-up.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import {basename, join, sep} from 'node:path'; 4 | import dropRight from 'lodash-es/dropRight.js'; 5 | import range from 'lodash-es/range.js'; 6 | 7 | export default function(files, startsFrom) { 8 | return range(startsFrom.split(sep).length) 9 | .map(end => dropRight(startsFrom.split(sep), end).join(sep)) 10 | .map(dir => files.map(file => join(dir, basename(file)))) 11 | .flat(Number.POSITIVE_INFINITY); 12 | }; 13 | -------------------------------------------------------------------------------- /docs/public/form.html: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /utils/is-faux-internal.js: -------------------------------------------------------------------------------- 1 | 2 | export default function(path, domains = []) { 3 | // filter out non-strings 4 | domains = domains.filter(domain => typeof domain === 'string'); 5 | 6 | // separate out strings and regex 7 | const regexers = domains.map(domain => new RegExp(domain)) ?? []; 8 | 9 | return false 10 | || domains.find(domain => path.startsWith(domain)) !== undefined 11 | || regexers.map(regexer => regexer.test(path)).find(matched => matched === true) !== undefined; 12 | } 13 | -------------------------------------------------------------------------------- /.lando.yml: -------------------------------------------------------------------------------- 1 | name: vitepress-theme-default-plus 2 | proxy: 3 | cli: 4 | - vitepress-theme-default-plus.lndo.site:5173 5 | services: 6 | cli: 7 | api: 4 8 | image: node:18 9 | command: sleep infinity 10 | ports: 11 | - 5173:5173/http 12 | scanner: false 13 | user: node 14 | build: 15 | app: | 16 | npm install 17 | tooling: 18 | node: 19 | service: cli 20 | npm: 21 | service: cli 22 | vitepress: 23 | service: cli 24 | cmd: npx vitepress 25 | -------------------------------------------------------------------------------- /utils/get-item-nl.js: -------------------------------------------------------------------------------- 1 | import {default as normalize} from './normalize-2base.js'; 2 | 3 | export default function getItemNormalizedLink(item, site) { 4 | // if we dont have what we need just return that garbage 5 | if (!item.link) return item.link; 6 | 7 | // if this is not a special mvb then just return 8 | if (item.rel !== 'mvb') return item.link; 9 | 10 | // otherwise normalize on version base 11 | return normalize(item.link, site?.themeConfig?.multiVersionBuild?.base ?? '/', site); 12 | }; 13 | -------------------------------------------------------------------------------- /docs/markdown/cards.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about custom card markdown containers in VitePress Default Theme + 3 | --- 4 | 5 | # Card Containers 6 | 7 | ::: card WAIT... ANOTHER WHAT? 8 | ![Another happy landing](https://c.tenor.com/e9yVO9Q1ckEAAAAC/kenobi-star-wars.gif) 9 | Another happy landing of course! 10 | ::: 11 | 12 | ```md 13 | ::: card WAIT... ANOTHER WHAT? 14 | ![Another happy landing](https://c.tenor.com/e9yVO9Q1ckEAAAAC/kenobi-star-wars.gif) 15 | Another happy landing of course! 16 | ::: 17 | ``` 18 | -------------------------------------------------------------------------------- /utils/parse-layouts.js: -------------------------------------------------------------------------------- 1 | import {resolve, basename} from 'node:path'; 2 | 3 | export default function(layouts = {}) { 4 | return Object.entries(layouts) 5 | .map(([name, layout]) => ({ 6 | name, 7 | var: basename(layout, '.vue'), 8 | from: layout, 9 | })) 10 | .map((layout, index) => ({ 11 | ...layout, 12 | add: ` app.component('${layout.name}', ${layout.var});`, 13 | index, 14 | import: `import ${layout.var} from '${resolve(layout.from)}';`, 15 | })); 16 | } 17 | -------------------------------------------------------------------------------- /utils/get-hubspot-headers.js: -------------------------------------------------------------------------------- 1 | 2 | export default function(id) { 3 | return [ 4 | ['script', { 5 | async: true, 6 | defer: true, 7 | id: 'hs-script-loader', 8 | src: `//js.hs-scripts.com/${id}.js`, 9 | }], 10 | ['script', {}, [ 11 | 'window.dataLayer = window.dataLayer || [];', 12 | 'window.hubspot = function(){dataLayer.push(arguments);}', 13 | `hubspot('js', new Date());`, 14 | `hubspot('config', '${id}');`, 15 | ].join('\n'), 16 | ], 17 | ]; 18 | }; 19 | -------------------------------------------------------------------------------- /docs/markdown/thumbnails.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about custom thumbnail markdown containers in VitePress Default Theme + 3 | --- 4 | 5 | # Thumbnail Containers 6 | 7 | :::: thumbnail 8 | ![kalabox1-dash](https://thinktandem.io/images/articles/kalabox1.png "Kalabox V1 Dashboard") 9 | ::: caption 10 | Kalabox Version 1 Dashboard 11 | ::: 12 | :::: 13 | 14 | ```md 15 | :::: thumbnail 16 | ![kalabox1-dash](https://thinktandem.io/images/articles/kalabox1.png "Kalabox V1 Dashboard") 17 | ::: caption 18 | Kalabox Version 1 Dashboard 19 | ::: 20 | :::: 21 | ```md 22 | -------------------------------------------------------------------------------- /vite/patch-vp-menu-columns-plugin.js: -------------------------------------------------------------------------------- 1 | import Debug from 'debug'; 2 | 3 | export default function({debug = Debug('@lando/vite-plugin')}) { // eslint-disable-line 4 | return { 5 | name: 'vp-menugroup-columns', 6 | enforce: 'pre', 7 | transform: (code, id) => { 8 | const menufile = 'VPMenu.vue'; 9 | if (id.endsWith(menufile)) { 10 | debug('patched %o to add columns support to dropdown menu groups', menufile); 11 | return code.replace(':items="item.items"', ':items="item.items" :columns="item.columns"'); 12 | } 13 | }, 14 | }; 15 | }; 16 | -------------------------------------------------------------------------------- /client/tags.data.js: -------------------------------------------------------------------------------- 1 | 2 | import Debug from 'debug'; 3 | 4 | import {default as getTags} from '../utils/get-tags.js'; 5 | 6 | const debug = Debug('@lando/tags.data.js'); // eslint-disable-line 7 | const siteConfig = globalThis.VITEPRESS_CONFIG; 8 | 9 | export default { 10 | async load() { 11 | const config = siteConfig?.userConfig?.themeConfig?.multiVersionBuild ?? {}; 12 | const root = siteConfig?.userConfig?.gitRoot; 13 | const tags = await getTags(root, config, {debug: debug.extend('get-tags')}); 14 | debug('loading tag data %o', tags); 15 | return tags; 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /docs/components/youtube.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + global YouTube components. 3 | contributors: 4 | merge: name 5 | debotify: true 6 | exclude: 7 | - John Ouellet 8 | - name: Bob 9 | email: frank@frank.com 10 | 11 | --- 12 | 13 | # YouTube 14 | 15 | ### Usage 16 | 17 | All you should need is the `id` of the YouTube video and you'll get a responsive full width embed. 18 | 19 | ```html 20 | 21 | ``` 22 | 23 | ### Example 24 | 25 | ```html 26 | 27 | ``` 28 | 29 | 30 | -------------------------------------------------------------------------------- /client/collections.data.js: -------------------------------------------------------------------------------- 1 | import Debug from 'debug'; 2 | import {default as createContentLoader} from '../utils/create-content-loader.js'; 3 | 4 | const config = globalThis.VITEPRESS_CONFIG?.site?.themeConfig?.collections ?? {}; 5 | const debug = Debug('@lando/collections.data.js'); // eslint-disable-line 6 | const siteConfig = globalThis.VITEPRESS_CONFIG; 7 | 8 | const patterns = Object.entries(config) 9 | .map(([type, config]) => config.patterns) 10 | .flat(Number.POSITIVE_INFINITY); 11 | 12 | debug('loading collections data with patterns config %o', patterns); 13 | 14 | export default createContentLoader(patterns, {siteConfig}, {debug}); 15 | -------------------------------------------------------------------------------- /client/team.data.js: -------------------------------------------------------------------------------- 1 | 2 | import Debug from 'debug'; 3 | 4 | import {default as getContributors} from '../utils/get-contributors.js'; 5 | 6 | const debug = Debug('@lando/team.data.js'); // eslint-disable-line 7 | const siteConfig = globalThis.VITEPRESS_CONFIG; 8 | 9 | export default { 10 | async load() { 11 | const contributors = siteConfig?.userConfig?.themeConfig?.contributors ?? false; 12 | const root = siteConfig?.userConfig?.gitRoot; 13 | const team = contributors !== false ? await getContributors(root, contributors, {debug: debug.extend('get-contribs'), paths: []}) : []; 14 | debug('loading team data %o', team); 15 | return team; 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /utils/merge-promise.js: -------------------------------------------------------------------------------- 1 | const nativePromisePrototype = (async () => {})().constructor.prototype; 2 | const descriptors = ['then', 'catch', 'finally'] 3 | .map(property => [ 4 | property, 5 | Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property), 6 | ]); 7 | 8 | export default function(thing, promise) { 9 | for (const [property, descriptor] of descriptors) { 10 | // eslint-disable-next-line max-len 11 | const value = typeof promise === 'function' ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise); 12 | Reflect.defineProperty(thing, property, {...descriptor, value}); 13 | } 14 | 15 | return thing; 16 | }; 17 | -------------------------------------------------------------------------------- /docs/team.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the team that made VitePress Default Theme Plus. 3 | layout: page 4 | title: Team 5 | --- 6 | 7 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | 25 | -------------------------------------------------------------------------------- /utils/is-active.js: -------------------------------------------------------------------------------- 1 | const EXT_RE = /(index)?\.(md|html)$/; 2 | const HASH_RE = /#.*$/; 3 | const inBrowser = typeof document !== 'undefined'; 4 | const normalize = path => decodeURI(path).replace(HASH_RE, '').replace(EXT_RE, ''); 5 | 6 | export default function isActive(currentPath, matchPath, asRegex) { 7 | if (matchPath === undefined) return false; 8 | 9 | currentPath = normalize(`/${currentPath}`); 10 | 11 | if (asRegex) return new RegExp(matchPath).test(currentPath); 12 | if (normalize(matchPath) !== currentPath) return false; 13 | 14 | const hashMatch = matchPath.match(HASH_RE); 15 | 16 | if (hashMatch) return (inBrowser ? location.hash : '') === hashMatch[0]; 17 | 18 | return true; 19 | }; 20 | -------------------------------------------------------------------------------- /docs/support.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contact Us 3 | description: Get help and support for VitePress Default Theme +. 4 | --- 5 | 6 | # Contact Us 7 | 8 | If you need priority and dedicated support, expediated bug fixes or more features then please contact us below. 9 | 10 |
11 | 12 |

13 | 14 |

15 |

16 | 17 |

18 |

19 | 20 |

21 |

22 | 23 |

24 |
25 | -------------------------------------------------------------------------------- /docs/config/create-content-loader.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + createContentLoader util. 3 | --- 4 | 5 | # createContentLoader 6 | 7 | If you are doing any [build-time data loading](https://vitepress.dev/guide/data-loading) we have a wrapper for `createContentLoader` which you can use instead of the [default one](https://vitepress.dev/guide/data-loading#createcontentloader). 8 | 9 | It works *more-or-less* the same way but you *should* pass in the `siteConfig` as part of the options as below: 10 | 11 | ```js 12 | import createContentLoader from '@lando/vitepress-theme-default-plus/ccl'; 13 | 14 | const siteConfig = globalThis.VITEPRESS_CONFIG; 15 | 16 | export default createContentLoader('posts/*.md', {siteConfig}); 17 | ``` 18 | -------------------------------------------------------------------------------- /utils/normalize-mvb.js: -------------------------------------------------------------------------------- 1 | export default function({ 2 | base = '/v/', 3 | build = 'stable', 4 | cache = true, 5 | match = 'v[0-9].*', 6 | mvbase = undefined, 7 | satisfies = '*', 8 | siteBase = '/', 9 | } = {}) { 10 | // if no mvbase then combine it with sitebase as usual, this is probabyl base reality 11 | if (!mvbase) mvbase = `/${siteBase}/${base}/`.replace(/\/{2,}/g, '/'); 12 | 13 | // if we are in a MVB then the OG base can get lost so rebase on that 14 | if (process.env.VPL_MVB_BUILD) mvbase = `/${process.env.VPL_MVB_BASE}/${base}/`.replace(/\/{2,}/g, '/'); 15 | if (process.env.LANDO_MVB_BUILD) mvbase = `/${process.env.LANDO_MVB_BASE}/${base}/`.replace(/\/{2,}/g, '/'); 16 | 17 | // return 18 | return {base, build, cache, match, mvbase, satisfies}; 19 | }; 20 | -------------------------------------------------------------------------------- /.github/workflows/pr-linter.yml: -------------------------------------------------------------------------------- 1 | name: Lint Code 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | lint: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: 12 | - ubuntu-24.04 13 | node-version: 14 | - '20' 15 | steps: 16 | # Install deps and cache 17 | - name: Checkout code 18 | uses: actions/checkout@v4 19 | - name: Install node ${{ matrix.node-version }} 20 | uses: actions/setup-node@v4 21 | with: 22 | node-version: ${{ matrix.node-version }} 23 | cache: npm 24 | - name: Install dependencies 25 | run: npm clean-install --prefer-offline --frozen-lockfile 26 | 27 | # Run the linter 28 | - name: Run code linter 29 | run: npm run lint 30 | -------------------------------------------------------------------------------- /docs/public/lando/favicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/lando/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/guides.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Home helpful guides for the VitePress Default Theme Plus. 3 | layout: page 4 | title: Guides 5 | sidebar: false 6 | --- 7 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /docs/blog.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Home helpful guides for the VitePress Default Theme Plus. 3 | layout: page 4 | title: Blog 5 | sidebar: false 6 | --- 7 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /utils/is-dev-release.js: -------------------------------------------------------------------------------- 1 | import * as semver from 'es-semver'; 2 | 3 | export default function(version) { 4 | // throw error if not a valid version 5 | if (semver.valid(semver.clean(version)) === null) { 6 | throw new Error(`${version} must be a semantic version for this to work!`); 7 | } 8 | 9 | // parse the version 10 | version = semver.parse(version); 11 | 12 | // if prerelease is empty then this is stable version 13 | if (version.prerelease.length === 0) return false; 14 | 15 | // if prerelease is length 2 with string and integer parts then this is a non-dev prerelease 16 | if (version.prerelease.length === 2 && typeof version.prerelease[0] === 'string' && Number.isInteger(version.prerelease[1])) { 17 | return false; 18 | } 19 | 20 | // if we get here then lets just assume its a dev release? 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /utils/get-timestamp.js: -------------------------------------------------------------------------------- 1 | import {existsSync} from 'node:fs'; 2 | import {basename, dirname} from 'node:path'; 3 | 4 | import Debug from 'debug'; 5 | 6 | import {default as execSync} from './parse-stdout.js'; 7 | 8 | export default function async(file, 9 | { 10 | debug = Debug('@lando/get-timestamp'), // eslint-disable-line 11 | } = {}, 12 | ) { 13 | // blow up 14 | const cwd = dirname(file); 15 | const fileName = basename(file); 16 | 17 | // if this is a new file then i guess just return now? 18 | if (!existsSync(cwd)) return Date.now(); 19 | 20 | // command and opts 21 | const command = ['git', 'log', '-1', '--pretty="%ai"', fileName]; 22 | const opts = {cwd, stdin: 'inherit'}; 23 | 24 | // run 25 | debug('running command %o with exec options %o', command, opts); 26 | const stdout = execSync(command.join(' '), opts); 27 | return stdout.trim(); 28 | } 29 | -------------------------------------------------------------------------------- /utils/get-base-url.js: -------------------------------------------------------------------------------- 1 | // @TODO: support other platforms besides netlify? 2 | 3 | export default function(landoPlugin) { 4 | // if VPL_BASE_URL is set then use that 5 | if (process.env?.VPL_BASE_URL) return process.env?.VPL_BASE_URL; 6 | 7 | // otherwise we can try other stuff if we are on something like netlify 8 | if (process.env?.NETLIFY && process.env.CONTEXT === 'production' && landoPlugin) return 'https://docs.lando.dev'; 9 | if (process.env?.NETLIFY && process.env.CONTEXT === 'production') return process.env.URL; 10 | if (process.env?.NETLIFY && process.env.CONTEXT !== 'production') return process.env.DEPLOY_PRIME_URL; 11 | 12 | // if we get here and its a lando plugin we can safely assume https://docs.lando.dev, this is mostly for github actions testing 13 | if (landoPlugin) return 'https://docs.lando.dev'; 14 | 15 | // return nothing 16 | return undefined; 17 | }; 18 | -------------------------------------------------------------------------------- /docs/composables/use-collection.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + useCollection composable. 3 | --- 4 | 5 | # useCollection 6 | 7 | You can `import` the `useCollection()` composable from `@lando/vitepress-theme-default-plus` and use it to create things like index `pages`, `prev` and `next` links and more. 8 | 9 | ```js 10 | const { 11 | hasItems, 12 | pages, 13 | page, 14 | nextPage, 15 | prevnext, 16 | prevPage, 17 | path, 18 | tags, 19 | } = useCollection(); 20 | ``` 21 | 22 | Or target a specific collection: 23 | 24 | ```js 25 | const data = useCollection('post'); 26 | ``` 27 | 28 | Here is how we generate our `/all` index page which contains a good mix of the most useful things above: 29 | 30 | ```html 31 | 32 | ``` 33 | 34 | For more detail on `Collections` components you can check [this](/pages/collections). 35 | -------------------------------------------------------------------------------- /docs/v/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: All Other documentation versions 3 | title: Docuverse 4 | contributors: false 5 | lastUpdated: false 6 | editLink: false 7 | next: false 8 | prev: false 9 | --- 10 | # Docuverse 11 | 12 |
13 |
14 | 15 | 27 | 28 |
29 | 30 |
31 | 32 |
33 | 34 | 40 | -------------------------------------------------------------------------------- /docs/composables/use-tags.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + useTags composable. 3 | --- 4 | 5 | # useTags 6 | 7 | You can `import` the `useTags()` composable from `@lando/vitepress-theme-default-plus` and use it to create a docs version index page or to show other taggy things. 8 | 9 | ```js 10 | const { 11 | // alias:ref pairs 12 | aliases, 13 | // alias:link pairs 14 | aliasLinks, 15 | // extended version information 16 | extended, 17 | // versions prepared for injection into `VPLVersionLink` 18 | links, 19 | // a list of all matched and satisfied versions 20 | versions, 21 | } = useTeam(); 22 | ``` 23 | 24 | Note that `aliasLinks` and `links` will _only_ be available if you've configured [Multiversion Build](./../config/config.md#multiversion-build). 25 | 26 | Here is how we generate our version [index page](/v/) at `/v/`. 27 | 28 | ```md 29 | 30 | ``` 31 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "mocha": true, 5 | "es6": true 6 | }, 7 | "parser": "vue-eslint-parser", 8 | "parserOptions": { 9 | "parser": "babel-eslint", 10 | "allowImportExportEverywhere": true, 11 | "sourceType": "module", 12 | "ecmaVersion": 9 13 | }, 14 | "extends": [ 15 | "plugin:vue/recommended", 16 | "google" 17 | ], 18 | "rules": { 19 | "vue/multi-word-component-names": 0, 20 | "linebreak-style": 0, 21 | "arrow-parens": ["error", 22 | "as-needed" 23 | ], 24 | "max-len": ["error", { 25 | "code": 12000, 26 | "ignoreComments": true 27 | }], 28 | "require-jsdoc": ["error", { 29 | "require": { 30 | "FunctionDeclaration": false, 31 | "MethodDefinition": false, 32 | "ClassDeclaration": false, 33 | "ArrowFunctionExpression": false, 34 | "FunctionExpression": false 35 | } 36 | }] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/markdown/boxes.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about custom boxes markdown containers in VitePress Default Theme + 3 | --- 4 | 5 | # Box Containers 6 | 7 | Boxes are basically [admonitions](./admonitions.md) without the title and are about the _color_ instead of the _type_. 8 | 9 | ::: box 10 | This is a box. 11 | ::: 12 | 13 | ::: box-blue 14 | This is a blue box. 15 | ::: 16 | 17 | ::: box-brand 18 | This is a brand box. 19 | ::: 20 | 21 | ::: box-green 22 | This is a green box. 23 | ::: 24 | 25 | ::: box-red 26 | This is a red box. 27 | ::: 28 | 29 | ::: box-yellow 30 | This is a yellow box. 31 | ::: 32 | 33 | The above is achieved with the following markdown: 34 | 35 | ```md 36 | ::: box 37 | This is a box. 38 | ::: 39 | 40 | ::: box-blue 41 | This is a blue box. 42 | ::: 43 | 44 | ::: box-brand 45 | This is a brand box. 46 | ::: 47 | 48 | ::: box-green 49 | This is a green box. 50 | ::: 51 | 52 | ::: box-red 53 | This is a red box. 54 | ::: 55 | 56 | ::: box-yellow 57 | This is a yellow box. 58 | ::: 59 | ``` 60 | 61 | -------------------------------------------------------------------------------- /node/build-collections.js: -------------------------------------------------------------------------------- 1 | import fg from 'fast-glob'; 2 | import Debug from 'debug'; 3 | 4 | export default async function(siteConfig, {debug = Debug('@lando/build-collections')} = {}) { // eslint-disable-line 5 | // ensure siteConfig.collections is at least an empty object 6 | if (!siteConfig.collections || typeof siteConfig.collections !== 'object') siteConfig.collections = {}; 7 | 8 | // before we start lets make sure we have a list of paths for each collection 9 | // we do it like this to minimize running fastglob a bunch of times 10 | for (const [collection, config] of Object.entries(siteConfig?.site?.themeConfig?.collections ?? {})) { 11 | if (!Array.isArray(siteConfig.collections[collection])) { 12 | siteConfig.collections[collection] = fg.globSync(config.patterns ?? [], { 13 | dot: true, 14 | cwd: siteConfig.srcDir, 15 | onlyFiles: true, 16 | }); 17 | debug('built collection %o with page listing %o', collection, siteConfig.collections[collection]); 18 | } 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /docs/composables/use-team.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + useTeam composable. 3 | --- 4 | 5 | # useTeam 6 | 7 | You can `import` the `useTeam()` composable from `@lando/vitepress-theme-default-plus` and use it to create a team or contributors page. 8 | 9 | ```js 10 | const members = useTeam(); 11 | ``` 12 | 13 | Here is how we generate our `/team` page: 14 | 15 | ```html 16 | 17 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | 35 | ``` 36 | 37 | For more detail on `Team` components you can check [this](/pages/teams). 38 | -------------------------------------------------------------------------------- /markdown/tabs-override-plugin.js: -------------------------------------------------------------------------------- 1 | import container from 'markdown-it-container'; 2 | import Debug from 'debug'; 3 | 4 | const parseTabsParams = input => { 5 | const match = input.match(/key:(\S+)/); 6 | return {shareStateKey: match?.[1]}; 7 | }; 8 | 9 | export default function(md, {debug = Debug('@lando/markdown-plugin')}) { // eslint-disable-line 10 | md.use(container, 'tabs', { 11 | render(tokens, index, _options, env) { 12 | const token = tokens[index]; 13 | const style = token.info.trim().slice(4).trim(); 14 | 15 | if (token.nesting === 1) { 16 | const params = parseTabsParams(token.info); 17 | const shareStateKeyProp = params.shareStateKey 18 | ? `sharedStateKey="${md.utils.escapeHtml(params.shareStateKey)}"` 19 | : ''; 20 | return `\n`; 21 | } else { 22 | return `\n`; 23 | } 24 | }, 25 | }); 26 | debug('override custom markdown container %o with styling support', 'vitepress-plugin-tabs'); 27 | }; 28 | -------------------------------------------------------------------------------- /docs/install.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to install and get started with VitePress Default Theme Plus! 3 | --- 4 | 5 | # Installation 6 | 7 | * [Node.js](https://nodejs.org/) version 18 or higher. 8 | * Terminal for accessing VitePress via its command line interface (CLI). 9 | * Text Editor with [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax support. 10 | * [VSCode](https://code.visualstudio.com/) is recommended, along with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar). 11 | 12 | VitePress can be used on its own, or be installed into an existing project. In both cases, you can install it with: 13 | 14 | ::: code-group 15 | ```sh [npm] 16 | $ npm install -D vitepress @lando/vitepress-theme-default-plus 17 | ``` 18 | 19 | ```sh [pnpm] 20 | $ pnpm add -D vitepress @lando/vitepress-theme-default-plus 21 | ``` 22 | 23 | ```sh [yarn] 24 | $ yarn add -D vitepress @lando/vitepress-theme-default-plus 25 | ``` 26 | 27 | ```sh [bun] 28 | $ bun add -D vitepress @lando/vitepress-theme-default-plus 29 | ``` 30 | ::: 31 | -------------------------------------------------------------------------------- /utils/create-container.js: -------------------------------------------------------------------------------- 1 | import container from 'markdown-it-container'; 2 | 3 | export default function(name, opts = {}, md) { 4 | return [container, name, { 5 | render(tokens, index, _options, env) { 6 | const token = tokens[index]; 7 | const info = token.info.trim().slice(name.length).trim() || opts.defaultTitle; 8 | const attrs = md.renderer.renderAttrs(token); 9 | 10 | // opening tag 11 | if (token.nesting === 1) { 12 | const title = info ? md.renderInline(info, {references: env.references}) : undefined; 13 | const titleMarkdown = title ? `

${title ? title : ''}

` : ''; 14 | 15 | // special handling for details 16 | if (name === 'details') return `
${title}\n`; 17 | // otherwise 18 | return `
${titleMarkdown}\n`; 19 | 20 | // closing tag 21 | } else return name === 'details' ? `
\n` : `\n`; 22 | }}, 23 | ]; 24 | }; 25 | -------------------------------------------------------------------------------- /client/use-tags.js: -------------------------------------------------------------------------------- 1 | import {data as tags} from './tags.data.js'; 2 | 3 | import {useData} from 'vitepress'; 4 | 5 | export default function useTags() { 6 | // get version path data 7 | const {theme} = useData(); 8 | // if no mvb then just return tags 9 | if (!theme.value.multiVersionBuild) return tags; 10 | 11 | // otherwise lets augment it with links and shit! 12 | const {base} = theme.value.multiVersionBuild; 13 | 14 | // generate links we can pass into VPLVersionLink 15 | const links = tags.versions 16 | .map(version => ({ 17 | text: version, 18 | href: `/${base}/${version}/`.replace(/\/{2,}/g, '/'), 19 | prerelease: /^v?\d+\.\d+\.\d+-\S+$/.test(version), 20 | stable: tags?.aliases?.stable === version, 21 | edge: tags?.aliases?.edge === version, 22 | })); 23 | 24 | // also generate alias linkes 25 | const aliasLinks = { 26 | dev: `/${base}/dev/`.replace(/\/{2,}/g, '/'), 27 | edge: `/${base}/edge/`.replace(/\/{2,}/g, '/'), 28 | stable: `/${base}/stable/`.replace(/\/{2,}/g, '/'), 29 | }; 30 | 31 | return {...tags, links, aliasLinks}; 32 | } 33 | -------------------------------------------------------------------------------- /utils/get-branch.js: -------------------------------------------------------------------------------- 1 | import {default as getStdOut} from './parse-stdout.js'; 2 | 3 | export default function async(cwd = process.cwd()) { 4 | // lando build env directly 5 | if (process.env?.VPL_MVB_BRANCH) return process.env?.VPL_MVB_BRANCH; 6 | // lando build env directly 7 | else if (process.env?.LANDO_MVB_BRANCH) return process.env?.LANDO_MVB_BRANCH; 8 | // or from source 9 | else if (process.env?.VPL_MVB_SOURCE) return getStdOut('git rev-parse --abbrev-ref HEAD', {cwd: process.env?.VPL_MVB_SOURCE, trim: true}); 10 | // or from source 11 | else if (process.env?.LANDO_MVB_SOURCE) return getStdOut('git rev-parse --abbrev-ref HEAD', {cwd: process.env?.LANDO_MVB_SOURCE, trim: true}); 12 | // or if we are on netlify 13 | else if (process.env?.NETLIFY) return process.env.HEAD; 14 | // or GHA PR 15 | else if (process.env?.GITHUB_HEAD_REF) return process.env.GITHUB_HEAD_REF; 16 | // or GHA branch 17 | else if (process.env?.GITHUB_REF_NAME) return process.env.GITHUB_REF_NAME; 18 | // otherwise try to get it from git 19 | else return getStdOut('git rev-parse --abbrev-ref HEAD', {cwd, trim: true}); 20 | }; 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Lando Alliance 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/components/jobs.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn about the VitePress Default Theme + global Jobs components. 3 | jobs: 4 | - title: 'Lando Developer' 5 | logo: 'https://docs.lando.dev/images/icon.svg' 6 | link: 'https://docs.google.com/forms/d/e/1FAIpQLSc2vkesq59BblKo8ZX-R1hKTrHphh1kmsg4FgWV1WH5BKEjHQ/viewform' 7 | company: 'Lando Alliance' 8 | aux: 'DC, Remote' 9 | --- 10 | 11 | # Jobs 12 | 13 | ### Usage 14 | 15 | To populate `` you will want to set the theme config [here](../config/config.html#jobs). 16 | 17 | You can also customize or disable the jobs on a per-page basis with [frontmatter](../config/frontmatter.html#jobs). 18 | 19 | ```html 20 | 21 | ``` 22 | 23 | ### Example - Defaults 24 | 25 | ```html 26 | 27 | ``` 28 | 29 | 30 | 31 | ### Example - Custom Title 32 | 33 | 34 | ```html 35 | 36 | ``` 37 | 38 | 39 | 40 | ### Example - No Title 41 | 42 | ```html 43 | 44 | ``` 45 | 46 | 47 | 48 | ::: tip NOTE 49 | You must use `:title` and not `title` to parse `"false"` correctly. 50 | ::: 51 | -------------------------------------------------------------------------------- /docs/guides/making-a-guide.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to automatically populate guide content using the VitePress Default Theme Plus. 3 | image: https://external-preview.redd.it/mj-2SFKKXAMK3tXrlo1smwLCSIantySqxSgfgMoJH2U.jpg?width=640&crop=smart&auto=webp&s=4f983b744fba16877e80218131a917b92904af26 4 | tag: tag 2 5 | --- 6 | 7 | # Making a guide 8 | 9 | Guides are _how tos_ or _tutorials_ that fit somewhere in between technical documentation and blog posts. They generally 10 | seek to answer a single question such as "How do I create a guide using this theme?" and are heavy on code snippets. 11 | 12 | In this case there are actually two ways to create a guide: 13 | 14 | * Autopopulating data from the `git log`. 15 | * [Manually entering data](./making-a-guide-2.html) 16 | 17 | ## Autopopulating data from `git log` 18 | 19 | You don't really have to do anything. Just make a commit to this page and you will show up like `Mike Pirog` does for this one. If you want to augment the `git log` data you should check out [this](../config/config#contributors). 20 | 21 | If you are interested in manually setting the `authors`, `date` and edit link then check out [Making a Guide 2](./making-a-guide-2.html) 22 | -------------------------------------------------------------------------------- /node/augment-authors.js: -------------------------------------------------------------------------------- 1 | import Debug from 'debug'; 2 | 3 | const getContributor = (id, contributors = []) => contributors.find(contributor => contributor.email === id) 4 | ?? contributors.find(contributor => contributor.name === id); 5 | 6 | const getLink = author => { 7 | if (author.link) return author.link; 8 | else if (Array.isArray(author?.links) && author.links[0]) return author.links[0].link; 9 | else if (author.email) return `mailto:${author.email}`; 10 | }; 11 | 12 | export default async function(pageData, { 13 | team, 14 | debug = Debug('@lando/augment-authors'), // eslint-disable-line 15 | } = {}) { 16 | debug = debug.extend(`${pageData.relativePath}`); 17 | const {frontmatter} = pageData; 18 | 19 | // normalize and augment author info 20 | if (Array.isArray(frontmatter.authors)) { 21 | frontmatter.authors = frontmatter.authors 22 | .map(author => typeof author === 'string' ? getContributor(author, team) : author) 23 | .filter(author => author && author !== false && author !== null) 24 | .map(author => ({...author, link: getLink(author)})); 25 | } 26 | 27 | // log 28 | debug('augmented author information to %o', {authors: frontmatter.authors}); 29 | }; 30 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Learn how to install and get started with VitePress Default Theme Plus! 3 | --- 4 | 5 | # Usage 6 | 7 | Before starting make sure you are familiar with [the basics](https://vitepress.dev/guide/getting-started#file-structure) of VitePress theme installation. 8 | 9 | To start using the theme you will want to create `.vitepress/theme/index.mjs` and `.vitepress/config.mjs` as below: 10 | 11 | ## .vitepress/theme/index.mjs 12 | 13 | ```js 14 | import {VPLTheme} from '@lando/vitepress-theme-default-plus'; 15 | export default VPLTheme; 16 | ``` 17 | 18 | If you want to extend our theme you should consult the [official docs](https://vitepress.dev/guide/extending-default-theme) on how to best do that. 19 | 20 | ## .vitepress/config.mjs 21 | 22 | Import our `defineConfig` wrapper and pass in hte [configuration](./config/config) you want. 23 | 24 | ```js 25 | import {defineConfig} from '@lando/vitepress-theme-default-plus/config'; 26 | 27 | export default defineConfig({ 28 | title: 'VitePress Theme +', 29 | description: 'The VitePress default theme with some MOARPOWAH!', 30 | base: '/', 31 | lang: 'en-US', 32 | themeConfig: { 33 | ... 34 | }, 35 | ... 36 | }); 37 | ``` 38 | -------------------------------------------------------------------------------- /components/VPLYouTube.vue: -------------------------------------------------------------------------------- 1 |