Skip to content

Commit

Permalink
change docs path (#75)
Browse files Browse the repository at this point in the history
* change docs path

* change docs path part 2

* disable core tests 4now

* update theme and fix navURL

* update theme and fix config

* favicon
  • Loading branch information
pirog authored Nov 1, 2024
1 parent 3db992e commit 7de0358
Show file tree
Hide file tree
Showing 9 changed files with 3,236 additions and 9,989 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/pr-core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# - stable
- 3-dev
node-version:
- '18'
- '20'
os:
- ubuntu-24.04

Expand All @@ -44,9 +44,9 @@ jobs:
# Eventually it would be great if these steps could live in a separate YAML file
# that could be included in line to avoid code duplication
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
Expand All @@ -59,28 +59,28 @@ jobs:
lando-plugin: true
version: dev
sync: false
- name: Setup lando ${{ matrix.lando-version }}
uses: lando/setup-lando@v2
with:
lando-version: ${{ matrix.lando-version }}
telemetry: false
config: |
setup.skipCommonPlugins=true
setup.plugins.@lando/core-next=/home/runner/work/core-next/core-next
# - name: Setup lando ${{ matrix.lando-version }}
# uses: lando/setup-lando@v3
# with:
# lando-version: ${{ matrix.lando-version }}
# telemetry: false
# config: |
# setup.skipCommonPlugins=true
# setup.plugins.@lando/core-next=/home/runner/work/core-next/core-next

# @TODO: swtich to @lando/setup-lando action?
- name: Globally dogfood the plugin
run: |
mkdir -p ~/.local/share/lando/plugins/@lando
ln -sf "$(pwd)" ~/.local/share/lando/plugins/@lando/core-next
ls -lsa ~/.local/share/lando/plugins/@lando
lando version --clear
- name: Verify we can run the packaged CLI
run: |
lando version --all
lando config
lando plugins
lando registry
# - name: Globally dogfood the plugin
# run: |
# mkdir -p ~/.local/share/lando/plugins/@lando
# ln -sf "$(pwd)" ~/.local/share/lando/plugins/@lando/core-next
# ls -lsa ~/.local/share/lando/plugins/@lando
# lando version --clear
# - name: Verify we can run the packaged CLI
# run: |
# lando version --all
# lando config
# lando plugins
# lando registry

# - name: Run Leia Tests
# uses: lando/run-leia-action@v2
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ jobs:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache version builds
uses: actions/cache@v4
with:
key: lando-mvb-docs
path: docs/.vitepress/cache/@lando/mvb
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand All @@ -29,8 +33,8 @@ jobs:

# Run tests
- name: Run linter
run: |
npm run lint
run: npm run lint
- name: Test mvb
run: npm run docs:mvb
- name: Test build
run: |
npm run docs:build
run: npm run docs:build
6 changes: 3 additions & 3 deletions .github/workflows/pr-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pr-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ jobs:
os:
- windows-2022
- ubuntu-24.04
- macos-12
- macos-13
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
os:
- ubuntu-24.04
node-version:
- '18'
- '20'
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
Expand Down
65 changes: 52 additions & 13 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -1,33 +1,72 @@
import {createRequire} from 'module';

import {defineConfig} from '@lando/vitepress-theme-default-plus/config';
import {default as getBaseUrl} from '@lando/vitepress-theme-default-plus/get-base-url';
import {default as isDevRelease} from '@lando/vitepress-theme-default-plus/is-dev-release';

const require = createRequire(import.meta.url);

const {name, version} = require('../../package.json');
const landoPlugin = name.replace('@lando/', '');
const pjson = require('../../package.json');
const landoPlugin = pjson.name.replace('@lando/', '');

// 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
const version = process?.env?.VPL_MVB_VERSION ? process.env.VPL_MVB_VERSION : `v${pjson.version}`;

// get baseUrl
const baseUrl = getBaseUrl();

const sidebarEnder = {
text: version,
collapsed: true,
items: [
{
text: 'Other Doc Versions',
items: [
{rel: 'mvb', text: 'stable', target: '_blank', link: '/v/stable/'},
{rel: 'mvb', text: 'edge', target: '_blank', link: '/v/edge/'},
{rel: 'mvb', text: '<strong>see all versions</strong>', link: '/v/'},
],
},
{text: 'Other Releases', link: 'https://github.com/lando/core-next/releases'},
],
};

if (sidebarEnder && !isDevRelease(version)) {
sidebarEnder.items.splice(1, 0, {
text: 'Release Notes',
link: `https://github.com/lando/core-next/releases/releases/tag/${version}`,
});
}

export default defineConfig({
title: 'Lando Core 4',
title: 'Lando 4',
description: 'The offical Lando Core 4 docs.',
landoDocs: 4,
landoPlugin,
version,
base: '/core/v4/',
base: '/v/next/',
baseUrl,
navBaseUrl: `${baseUrl}/v/next`,
head: [
['meta', {name: 'viewport', content: 'width=device-width, initial-scale=1'}],
['link', {rel: 'icon', href: '/core/favicon.ico', size: 'any'}],
['link', {rel: 'icon', href: '/core/favicon.svg', type: 'image/svg+xml'}],
['link', {rel: 'icon', href: '/favicon.ico', size: 'any'}],
['link', {rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml'}],
],
themeConfig: {
sidebarEnder: {
text: `${landoPlugin}@v${version}`,
collapsed: true,
items: [
{text: 'Release Notes', link: `https://github.com/lando/core-next/releases/tag/v${version}`},
{text: 'Older Versions', link: `https://github.com/lando/core-next/releases`},
],
internalDomains: [
'^https:\/\/lando-core-next\.netlify\.app(\/.*)?$',
'^https:\/\/[a-zA-Z0-9-]+--lando-core-next\.netlify\.app(\/.*)?$',
],
multiVersionBuild: {
build: 'dev',
satisfies: '>=4.0.0',
},
sidebarEnder,
sidebar: [
{
text: 'Landofile',
Expand Down
23 changes: 13 additions & 10 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
[build]
base = "./"
publish = "./docs/.vitepress/dist"
command = "npx mvb docs"

[context.deploy-preview]
command = "npm run docs:build"

# https://github.com/munter/netlify-plugin-checklinks#readme
[[context.deploy-preview.plugins]]
package = "netlify-plugin-checklinks"
[context.deploy-preview.plugins.inputs]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com", "/v/" ]
skipPatterns = [ ".rss", ".gif", ".jpg" ]
checkExternal = true

# Sets our asset optimization
[build.processing.css]
bundle = true
Expand All @@ -28,20 +39,12 @@
[plugins.inputs.audits]
output_path = "reports/lighthouse.html"

# https://github.com/munter/netlify-plugin-checklinks#readme
[[plugins]]
package = "netlify-plugin-checklinks"
[plugins.inputs]
todoPatterns = [ "load", "CHANGELOG.html", "x.com", "twitter.com" ]
skipPatterns = [ ".rss", ".gif", ".jpg" ]
checkExternal = true

# We need this so preview environments and the base site look ok on their own
[[redirects]]
from = "/"
to = "/core/v4"
to = "/v/next"
status = 200
[[redirects]]
from = "/core/v4/*"
from = "/v/next/*"
to = "/:splat"
status = 200
Loading

0 comments on commit 7de0358

Please sign in to comment.