Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ad2f2fa
updates for theme
dovholuknf Jan 26, 2026
7c08df7
update browser list
dovholuknf Jan 26, 2026
71025f0
continuing to move towards a theme
dovholuknf Jan 27, 2026
5fae14c
cross building scripts
dovholuknf Jan 27, 2026
2ae329f
add test formatting docs and update footer
dovholuknf Jan 27, 2026
7f2d795
v0.3.2
dovholuknf Jan 27, 2026
48f6f27
v0.3.4
dovholuknf Jan 27, 2026
93b93ee
v0.3.5
dovholuknf Jan 27, 2026
f078d75
getting search to work
dovholuknf Jan 27, 2026
4e9ae64
v0.3.6
dovholuknf Jan 27, 2026
7151eb0
updates to theme
dovholuknf Jan 27, 2026
c33c128
update branches to test
dovholuknf Jan 27, 2026
d831697
update frontdoor to develop
dovholuknf Jan 28, 2026
8689279
use proper branch name in zlan
dovholuknf Jan 28, 2026
70a88f1
add backstop for visual diffing adn try to fix preview env
dovholuknf Jan 28, 2026
08b5e0b
freshen if the target exists
dovholuknf Jan 28, 2026
ad1c1d0
updates for local v vercel deployments too
dovholuknf Jan 28, 2026
5367b23
more vercel preview work
dovholuknf Jan 28, 2026
80cda90
keep trying to update better
dovholuknf Jan 28, 2026
1899703
still trying to get it right'
dovholuknf Jan 28, 2026
8d9c579
adding logging
dovholuknf Jan 28, 2026
927e47d
add find step
dovholuknf Jan 28, 2026
a579a70
move the clean command location
dovholuknf Jan 28, 2026
697ab1e
removing stripDocsPrefix
dovholuknf Jan 29, 2026
209b1c2
updates for building vercel
dovholuknf Jan 29, 2026
127f042
chagne onprem branch'
dovholuknf Jan 29, 2026
2e5e09e
update Layout
dovholuknf Jan 29, 2026
86e3dc4
update branches for ziti/zlan
dovholuknf Jan 29, 2026
0018cc2
add build-doc debugging
dovholuknf Jan 29, 2026
10d0b9e
build-doc updates
dovholuknf Jan 29, 2026
a3afd06
Merge remote-tracking branch 'origin/main' into update-to-theme
dovholuknf Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 67 additions & 14 deletions unified-doc/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,46 @@ QUALIFIER_FLAG=()
OTHER_FLAGS=()
EXTRA_ARGS=()

for arg in "$@"; do
case $arg in
--clean) CLEAN=1; OTHER_FLAGS+=("$arg") ;;
--lint-only) LINT_ONLY=1 ;;
--qualifier=*) BUILD_QUALIFIER="${arg#*=}"; QUALIFIER_FLAG=("$arg") ;;
-*) OTHER_FLAGS+=("$arg") ;; # Pass through flags like -ds, -z
*) EXTRA_ARGS+=("$arg") ;;
while [[ $# -gt 0 ]]; do
case $1 in
--clean) CLEAN=1; shift ;;
--lint-only) LINT_ONLY=1; shift ;;
--qualifier=*) BUILD_QUALIFIER="${1#*=}"; QUALIFIER_FLAG=("$1"); shift ;;
--qualifier)
if [[ -n "${2:-}" && ! "$2" =~ ^- ]]; then
BUILD_QUALIFIER="$2"; QUALIFIER_FLAG=("--qualifier=$2"); shift 2
else
echo "Error: --qualifier requires a value" >&2; exit 1
fi
;;
-*) OTHER_FLAGS+=("$1"); shift ;;
*) EXTRA_ARGS+=("$1"); shift ;;
esac
done

# --- DEBUG CONFIG ---
echo "========================================"
echo "bd BUILD ENVIRONMENT DEBUG"
echo "========================================"
echo "bd CLEAN=$CLEAN"
echo "bd BUILD_QUALIFIER='$BUILD_QUALIFIER'"
echo "bd QUALIFIER_FLAG: ${QUALIFIER_FLAG[*]}"
echo "bd OTHER_FLAGS: ${OTHER_FLAGS[*]}"
echo "bd EXTRA_ARGS: ${EXTRA_ARGS[*]}"
echo "bd QUALIFIER_FLAG: ${QUALIFIER_FLAG[*]:-}"
echo "bd OTHER_FLAGS: ${OTHER_FLAGS[*]:-}"
echo "bd EXTRA_ARGS: ${EXTRA_ARGS[*]:-}"
echo "----------------------------------------"
echo "bd ENV VARS:"
echo "bd IS_VERCEL='${IS_VERCEL:-}'"
echo "bd VERCEL='${VERCEL:-}'"
echo "bd VERCEL_ENV='${VERCEL_ENV:-}'"
echo "bd CI='${CI:-}'"
echo "bd NODE_ENV='${NODE_ENV:-}'"
echo "bd PWD='$(pwd)'"
echo "----------------------------------------"
echo "bd VERSIONS:"
echo "bd node: $(node --version 2>/dev/null || echo 'not found')"
echo "bd yarn: $(yarn --version 2>/dev/null || echo 'not found')"
echo "bd npm: $(npm --version 2>/dev/null || echo 'not found')"
echo "========================================"

script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"

Expand Down Expand Up @@ -261,11 +285,23 @@ if [ "${CLEAN:-0}" -eq 1 ]; then
fi

clone_or_update "https://bitbucket.org/netfoundry/zrok-connector.git" frontdoor develop
clone_or_update "https://bitbucket.org/netfoundry/k8s-on-prem-installations.git" onprem update-to-theme
clone_or_update "https://github.com/openziti/ziti-doc.git" openziti update-to-theme
clone_or_update "https://github.com/netfoundry/zlan.git" zlan use-theme
clone_or_update "https://bitbucket.org/netfoundry/k8s-on-prem-installations.git" onprem main
clone_or_update "https://github.com/openziti/ziti-doc.git" openziti main
clone_or_update "https://github.com/netfoundry/zlan.git" zlan main
clone_or_update "https://github.com/openziti/zrok.git" zrok update-to-theme

echo "========================================"
echo "bd POST-CLONE DEBUG"
echo "========================================"
echo "bd Directories in _remotes:"
ls -la "$script_dir/_remotes" 2>/dev/null || echo " (none)"
echo "----------------------------------------"
echo "bd Looking for build/ and .docusaurus/ dirs in remotes:"
find "$script_dir/_remotes" -type d \( -name "build" -o -name ".docusaurus" \) 2>/dev/null || echo " (none found)"
echo "bd Cleaning stale build artifacts from remotes..."
find "$script_dir/_remotes" -type d \( -name "build" -o -name ".docusaurus" \) -exec rm -rf {} + 2>/dev/null || true
echo "========================================"

echo "copying versionable docs locally..."
"${script_dir}/sync-versioned-remote.sh" zrok

Expand All @@ -282,11 +318,28 @@ export SDK_ROOT_TARGET="${script_dir}/static/openziti/reference/developer/sdk"
echo "creating openziti SDK target if necessary at: ${SDK_ROOT_TARGET}"
mkdir -p "${SDK_ROOT_TARGET}"

"${script_dir}/_remotes/openziti/gendoc.sh" "${OTHER_FLAGS[@]}"
# -d = skip docusaurus build (unified-doc does its own build)
"${script_dir}/_remotes/openziti/gendoc.sh" -d "${OTHER_FLAGS[@]}"

# --- STEP 3: DOCUSAURUS BUILD ---
pushd "${script_dir}" >/dev/null
yarn install

if [ "${CLEAN:-0}" -eq 1 ]; then
echo "bd CLEAN=1: running yarn clear to remove .docusaurus cache"
yarn clear
fi

echo "========================================"
echo "bd PRE-BUILD DEBUG"
echo "========================================"
echo "bd IS_VERCEL='${IS_VERCEL:-}'"
echo "bd VERCEL='${VERCEL:-}'"
echo "bd script_dir='${script_dir}'"
echo "bd BUILD_QUALIFIER='${BUILD_QUALIFIER}'"
echo "bd output dir: build${BUILD_QUALIFIER}"
echo "========================================"

now=$(date)
echo "$now" > "${script_dir}/static/build-time.txt"
echo "BUILDING docs into: build${BUILD_QUALIFIER} at $now"
Expand Down
43 changes: 42 additions & 1 deletion unified-doc/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const cfg: PublishConfig = process.env.DOCUSAURUS_PUBLISH_ENV === 'prod' ? prod
const REMARK_MAPPINGS = [
{ from: '@onpremdocs', to: `${docsBase}onprem` },
{ from: '@openzitidocs', to: `${docsBase}openziti`},
{ from: '@zrokdocs', to: `${docsBase}zrok`},
{ from: '@static', to: docsBase},
];

Expand All @@ -87,6 +88,8 @@ console.log(" docsBase : " + docsBase);
console.log(" algolia index : " + cfg.algolia.indexName);
console.log(" build mask : " + buildMask);
console.log(" hotjar app : " + cfg.hotjar.id);
console.log('REMARK_MAPPINGS:', JSON.stringify(REMARK_MAPPINGS, null, 2));


function extendDocsPlugins(plugin: PluginConfig): PluginConfig {
if (!Array.isArray(plugin)) return plugin;
Expand All @@ -107,6 +110,44 @@ function extendDocsPlugins(plugin: PluginConfig): PluginConfig {
return [pluginName, config];
}

function dumpRoutes() {
return {
name: 'dump-routes',
async allContentLoaded({allContent, actions}: any) {
const fs = require('node:fs');

// route list (most stable in v3)
const routes = actions.routesPaths ?? actions.routePaths ?? [];

// optional: also dump plugin content ids so you can correlate routes
fs.writeFileSync(
'routes.json',
JSON.stringify({routes, allContent}, null, 2),
);
},
};
}

function assertNoDocsPrefix() {
return (tree: any, file: any) => {
const p = String(file.path || '');
const {visit} = require('unist-util-visit');

visit(tree, 'link', (node: any) => {
if (typeof node.url === 'string' && node.url.startsWith('/docs/')) {
console.log(`[assertNoDocsPrefix] ${p} url=${node.url}`);
}
});

visit(tree, 'jsx', (node: any) => {
if (typeof node.value === 'string' && node.value.includes('"/docs/')) {
console.log(`[assertNoDocsPrefix] ${p} jsx contains "/docs/`);
}
});
};
}


const config: Config = {
title: 'NetFoundry Documentation',
tagline: 'Documentation for NetFoundry products and projects',
Expand Down Expand Up @@ -293,7 +334,7 @@ const config: Config = {
blogSidebarTitle: 'All posts',
},
],
build(BUILD_FLAGS.ZROK) && extendDocsPlugins(zrokDocsPluginConfig(zrokRoot)),
build(BUILD_FLAGS.ZROK) && extendDocsPlugins(zrokDocsPluginConfig(zrokRoot, REMARK_MAPPINGS)),
// Fallback redirects for JSX pages with hardcoded /docs/ paths (from upstream repos)
isVercel && [
'@docusaurus/plugin-client-redirects',
Expand Down
30 changes: 19 additions & 11 deletions unified-doc/src/theme/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {type ReactNode} from 'react';
import {NetFoundryLayout, NetFoundryLayoutProps, StarUsProps} from '@netfoundry/docusaurus-theme/ui';
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import {useLocation} from "@docusaurus/router";
import {unifiedFooter} from "@site/src/components/footer";
import {frontdoorFooter} from "@frontdoor/src/components/footer";
Expand All @@ -9,22 +8,31 @@ import {zlanFooter} from "@zlan/src/components/footer";
import {openZitiFooter} from "@openziti/src/components/footer";
import {zrokFooter} from "@zrok/src/components/footer";

const matchPath = (p: string, segment: string) =>
p.startsWith(`/${segment}`) || p.startsWith(`/docs/${segment}`);

const mapFooter = (p: string) => {
if (p.startsWith('/docs/frontdoor')) return frontdoorFooter;
if (p.startsWith('/docs/onprem')) return onpremFooter;
if (p.startsWith('/docs/openziti')) return openZitiFooter;
if (p.startsWith('/docs/zlan')) return zlanFooter;
if (p.startsWith('/docs/zrok')) return zrokFooter;
if (matchPath(p, 'frontdoor')) return frontdoorFooter;
if (matchPath(p, 'onprem')) return onpremFooter;
if (matchPath(p, 'openziti')) return openZitiFooter;
if (matchPath(p, 'zlan')) return zlanFooter;
if (matchPath(p, 'zrok')) return zrokFooter;
return unifiedFooter;
};

export default function LayoutWrapper(props: NetFoundryLayoutProps): ReactNode {
const {siteConfig} = useDocusaurusContext();
const {pathname} = useLocation();
const starProps: StarUsProps = {}
if (pathname.startsWith('/docs/openziti')) {
starProps.repoUrl = 'https://github.com/openziti/ziti';
starProps.label = 'Support OpenZiti, give us a GitHub Star';
let starProps: StarUsProps | undefined;
if (matchPath(pathname, 'openziti')) {
starProps = {
repoUrl: 'https://github.com/openziti/ziti',
label: 'Star OpenZiti on GitHub',
};
} else if (matchPath(pathname, 'zrok')) {
starProps = {
repoUrl: 'https://github.com/openziti/zrok',
label: 'Star zrok on GitHub',
};
}
const footerToShow = mapFooter(pathname);
return (
Expand Down