import {default as isDevRelease} from '@lando/vitepress-theme-default-plus/is-dev-release'; import {default as getBaseUrl} from '@lando/vitepress-theme-default-plus/get-base-url'; import uniq from 'lodash-es/uniq.js'; export default function({ base, landoPlugin, themeConfig, version, baseUrl = getBaseUrl() ?? 'https://docs.lando.dev', navrel = 'root', } = {}) { // if this is a lando plugin then reset the baseUrl if (landoPlugin) baseUrl = getBaseUrl(landoPlugin); // reset the base if its undefined if (!base) base = landoPlugin ? `/plugins/${landoPlugin}/` : '/'; // reset baseUrl with dat base baseUrl = `${baseUrl}${base}`; // backwards compat with LANDO_MVB_VERSION if (!process?.env?.VPL_MVB_VERSION && process?.env?.LANDO_MVB_VERSION) { process.env.VPL_MVB_VERSION = process.env.LANDO_MVB_VERSION; } // allow version to imported from ENV which is nice for one-off dev builds version = process?.env?.VPL_MVB_VERSION ? process.env.VPL_MVB_VERSION : `v${version}`; // construct the rest const text = ['core'].includes(landoPlugin) ? version : `${landoPlugin}@${version}`; const repo = landoPlugin ? `https://github.com/lando/${landoPlugin}` : 'https://github.com/lando'; // if no sidebar ender and we have plugin/version then do it if (!themeConfig.sidebarEnder && themeConfig.sidebarEnder !== false && landoPlugin && version) { themeConfig.sidebarEnder = { text, collapsed: true, items: [ { text: 'Other Doc Versions', items: [ {rel: 'mvb', text: 'stable', target: '_blank', link: '/stable/'}, {rel: 'mvb', text: 'edge', target: '_blank', link: '/edge/'}, {rel: 'mvb', text: 'see all versions', link: '/'}, ], }, {text: 'Other Releases', link: `${repo}/releases`}, ], }; // add release notes if (themeConfig.sidebarEnder && !isDevRelease(version)) { themeConfig.sidebarEnder.items.splice(1, 0, { text: 'Release Notes', link: `${repo}/releases/tag/${version}`, }); } } // combine internals themeConfig.internalDomains = themeConfig.internalDomains ?? []; // add the usual domains themeConfig.internalDomains.push( 'http://localhost', 'https://localhost', 'http://docs.lando.dev', 'https://docs.lando.dev', getBaseUrl(landoPlugin), ); // if plugin then add netlify stuff if (landoPlugin) { themeConfig.internalDomains.push(`^https:\/\/lando-${landoPlugin}\.netlify\.app(\/.*)?$`); themeConfig.internalDomains.push(`^https:\/\/[a-zA-Z0-9-]+--lando-${landoPlugin}\.netlify\.app(\/.*)?$`); } return { base, collections: {}, feed: { patterns: ['*.md', '*/**/*.md'], }, lang: 'en-US', markdown: {}, robots: { host: baseUrl, sitemap: `${baseUrl}sitemap.xml`, disallowAll: false, allowAll: false, policy: [], policies: [{ userAgent: '*', disallow: ['/v/'], allow: '/', }], }, sitemap: { hostname: getBaseUrl(landoPlugin) ?? 'https://docs.lando.dev/', lastmodDateOnly: false, transformItems: items => { for (const item of items) { item.url = `${base}${item.url}`; item.priority = 0.5; item.changefreq = 'daily'; } return items; }, }, themeConfig: { alert: false, autometa: { canonicalUrl: getBaseUrl(landoPlugin) ?? 'https://docs.lando.dev/', image: 'https://docs.lando.dev/images/icon.png', x: '@devwithlando', }, carbonAds: { code: 'CE7DCKJU', placement: 'landodev', }, collections: { post: { frontmatter: { collection: 'post', contributors: false, backLink: { text: '<- Back to blog', link: '/blog', }, aside: false, sidebar: false, prev: false, next: false, editLink: false, }, icon: '', iconLink: '/blog', patterns: ['blog/**/*.md'], }, guide: { frontmatter: { collection: 'guide', }, icon: '', iconLink: '/guides', patterns: ['guides/**/*.md'], }, }, containers: { 'brand': {defaultTitle: 'BRAND'}, 'box': {}, 'box-blue': {}, 'box-brand': {}, 'box-green': {}, 'box-red': {}, 'box-yellow': {}, 'caption': {}, 'card': {}, 'center': {}, 'half': {}, 'highlight': {}, 'left': {}, 'right': {}, 'success': {defaultTitle: 'SUCCESS'}, 'third': {}, 'thumbnail': {}, }, contributors: { merge: 'name', debotify: true, include: [ { name: 'Mike Pirog', email: 'mike@lando.dev', title: 'Co-founder', org: 'lando.dev', orgLink: 'https://lando.dev', links: [ {icon: 'github', link: 'https://github.com/pirog'}, {icon: 'twitter', link: 'https://twitter.com/pirogcommamike'}, ], sponsor: 'https://lando.dev/sponsor', maintainer: true, mergeOnly: true, }, { name: 'John Ouelett', email: 'john@thinktandem.io', title: 'Robot From Future', mergeOnly: true, }, { avatar: 'https://avatars.githubusercontent.com/u/1153738', name: 'Alec Reynolds', email: 'alec+git@lando.dev', title: 'Co-founder', org: 'lando.dev', orgLink: 'https://lando.dev', desc: 'A chill dude', links: [ {icon: 'github', link: 'https://github.com/reynoldsalec'}, {icon: 'twitter', link: 'https://twitter.com/reynoldsalec'}, ], sponsor: 'https://lando.dev/sponsor', maintainer: true, mergeOnly: true, }, ], }, editLink: { pattern: `${repo}/edit/main/docs/:path`, }, internalDomain: [], internalDomains: uniq(themeConfig.internalDomains), ga: {id: 'G-ZSK3T9FTQ9'}, hubspot: {id: '6478338'}, 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 Alliance', aux: 'DC, Remote', }, ], lastUpdated: { text: 'Updated', formatOptions: { dateStyle: 'timeago', }, }, layouts: {}, logo: {src: '/images/icon.svg', width: 24, height: 24}, multiVersionBuild: { base: '/v/', build: 'stable', cache: true, match: 'v[0-9].*', satisfies: '>=1.0.0', ag: 'edge', }, nav: [], sidebar: {}, sidebarEnder: themeConfig.sidebarEnder ?? false, search: { provider: 'algolia', options: { appId: '9S3BH0SKWT', apiKey: 'dbdd36d83bdc347eb485aa13f381527c', indexName: 'lando', }, }, sharedNav: sharedNav(navrel), socialLinks: [ { icon: 'github', link: repo, }, { icon: 'x', link: 'https://x.com/@devwithlando', }, { icon: 'youtube', link: 'https://www.youtube.com/channel/UCl_QBNuGJNoo7yH-n18K7Kg', }, { icon: { svg: '', }, link: 'https://lando.dev/sponsor', }, ], sponsors: { text: 'your logo?', link: 'https://lando.dev/sponsor', data: 'https://raw.githubusercontent.com/lando/lando/main/patriots.yaml', all: 'https://raw.githubusercontent.com/lando/lando/main/sponsors.yaml', }, tags: {}, tagLink: undefined, team: [], }, vite: { css: { preprocessorOptions: { sass: {api: 'modern-compiler'}, scss: {api: 'modern-compiler'}, }, }, optimizeDeps: {exclude: []}, plugins: [], resolve: {alias: []}, ssr: {noExternal: []}, }, }; }; function sharedNav(rel = navrel) { return [ { text: 'Getting Started', link: `/getting-started/`, activeMatch: '/contrib|/getting-started|/guides|/help|/install|/lando-101|/security|/support|/team|/troubleshooting', rel, }, { text: 'CLI', link: `/cli/`, activeMatch: '/cli', rel, }, { text: 'Config', activeMatch: '/config/|/landofile', items: [ { text: 'Landofile', columns: 3, items: [ {text: 'Basics', link: `/landofile/index.html`, rel}, {text: 'Services', link: `/landofile/services.html`, rel}, {text: 'Recipes', link: `/landofile/recipes.html`, rel}, {text: 'Tooling', link: `/landofile/tooling.html`, rel}, {text: 'Proxy', link: `/landofile/proxy.html`, rel}, {text: 'Events', link: `/landofile/events.html`, rel}, ], }, { text: 'Global Config', columns: 3, items: [ {text: 'Global', link: `/config/global.html`, rel}, {text: 'Environment', link: `/config/env.html`, rel}, {text: 'Experimental', link: `/config/experimental.html`, rel}, {text: 'Healthcheck', link: `/config/healthcheck.html`, rel}, {text: 'Orchestrator', link: `/config/orchestrator.html`, rel}, {text: 'Networking', link: `/config/networking.html`, rel}, {text: 'Performance', link: `/config/performance.html`, rel}, {text: 'Plugins', link: `/config/plugins.html`, rel}, {text: 'Releases', link: `/config/releases.html`, rel}, {text: 'Scanner', link: `/config/scanner.html`, rel}, {text: 'Security', link: `/config/security.html`, rel}, {text: 'SSH', link: `/config/ssh.html`, rel}, {text: 'Shared Files', link: `/config/files.html`, rel}, ], }, ], }, { text: 'Services', activeMatch: '/services', items: [ { text: 'API 3', columns: 2, items: [ {text: 'Lando', link: `/services/lando-3.html`, rel}, ], }, { text: 'API 4', columns: 2, items: [ { text: 'L-337 Service', link: `/services/l337.html`, rel, alert: { text: 'BETA!', type: 'new', }, }, ], }, ], }, { text: 'Plugins', activeMatch: '/plugins', link: `/plugins/`, rel, }, ]; };