Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 25 additions & 3 deletions packages/docusaurus-theme/css/product-picker.css
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,34 @@
.nf-picker-panel--narrow { max-width: 430px; padding: 0.85rem 1.25rem; }


/* Ensure visibility when open */
.dropdown--show > .dropdown__menu,
.dropdown:hover > .dropdown__menu {
/*
* Click-only dropdowns — how this works:
*
* Infima (Docusaurus's base CSS) shows .dropdown__menu on :hover by default.
* Our swizzled DropdownNavbarItem/Desktop uses JS click to toggle the
* `dropdown--show` class instead. We need CSS to respect that.
*
* The trick: both rules below have the same specificity (0,3,0). The hide
* rule kills Infima's hover behaviour; the show rule comes *later* in the
* file, so it wins the cascade when `dropdown--show` is present — even while
* the user is hovering.
*
* To verify: hover over any navbar dropdown → menu stays closed.
* Click the trigger → menu opens and stays open while hovering.
* Click a menu item or anywhere outside → menu closes.
*/
.navbar__item.dropdown:hover .dropdown__menu,
.navbar__item.dropdown:hover > .dropdown__menu {
display: none;
visibility: hidden;
opacity: 0;
pointer-events: none;
}
.navbar__item.dropdown.dropdown--show .dropdown__menu {
display: block;
visibility: visible;
opacity: 1;
pointer-events: auto;
}

/* ── Grid layout ────────────────────────────────────────────────────────── */
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@netfoundry/docusaurus-theme",
"version": "0.10.19",
"version": "0.10.20",
"description": "NetFoundry Docusaurus theme with shared layout, footer, and styling",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ export default function DropdownNavbarItemDesktop({
aria-haspopup="true"
aria-expanded={showDropdown}
role="button"
href={props.to ? undefined : '#'}
href="#"
className={clsx('navbar__link', className)}
{...props}
onClick={props.to ? undefined : handleClick}
to={undefined}
onClick={handleClick}
onKeyDown={(e: React.KeyboardEvent) => {
if (e.key === 'Enter') {
e.preventDefault();
Expand All @@ -66,7 +67,7 @@ export default function DropdownNavbarItemDesktop({
}}>
{props.children ?? props.label}
</NavbarNavLink>
<ul className="dropdown__menu">
<ul className="dropdown__menu" onClick={() => setShowDropdown(false)}>
{items.map((childItemProps: any, i: number) => (
<NavbarItem
isDropdownItem
Expand Down
23 changes: 16 additions & 7 deletions unified-doc/build-docs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ param(
[string]$FrontdoorBranch = "develop",
[string]$SelfhostedBranch = "main",
[string]$ZlanBranch = "main",
[string]$PlatformBranch = "main",

# Remove all _remotes content and .docusaurus cache before building
[switch]$Clean,
Expand All @@ -46,7 +47,7 @@ param(
[string]$Qualifier = "",

# Docusaurus build mask (hex). 0x1=openziti, 0x2=frontdoor, 0x4=selfhosted,
# 0x8=zrok, 0x10=zlan, 0xFF=all
# 0x8=zrok, 0x10=zlan, 0x20=platform, 0xFF=all
[string]$BuildMask = "0xFF"
)

Expand Down Expand Up @@ -98,10 +99,9 @@ function Invoke-CloneOrUpdate {

$target = Join-Path $remotesDir $Dest
$redactedUrl = $Url -replace '://[^@]+@', '://[REDACTED]@'
Write-Host "bd clone_or_update: dest='$Dest' branch='$Branch' url='$redactedUrl'"

if (Test-Path (Join-Path $target ".git")) {
Write-Host "bd existing repo detected; fetching branch '$Branch'"
Write-Host "Updating '$Dest' @ '$Branch'..."
git -C $target remote set-url origin $Url 2>&1 | Out-Null
if ($LASTEXITCODE -ne 0) {
git -C $target remote add origin $Url 2>&1 | Out-Null
Expand All @@ -119,14 +119,13 @@ function Invoke-CloneOrUpdate {
if ($LASTEXITCODE -ne 0) {
Write-Error "Failed to reset '$target' to FETCH_HEAD"
}
Write-Host "bd fetch+reset succeeded"
return
} elseif (Test-Path $target) {
Write-Host "ERROR: $target exists but is not a git repo"
Get-ChildItem $target | Format-List Name
exit 1
} else {
Write-Host "bd cloning branch '$Branch' -> '$target'"
Write-Host "Cloning '$Dest' @ '$Branch'..."
git clone --single-branch --branch $Branch --depth 1 $Url $target
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Clone failed. Available branches in $redactedUrl :"
Expand All @@ -135,7 +134,6 @@ function Invoke-CloneOrUpdate {
}
exit 1
}
Write-Host "bd clone succeeded"
}
}

Expand Down Expand Up @@ -166,7 +164,8 @@ function Invoke-LintDocs {
(Join-Path $remotesDir "frontdoor\docusaurus\docs"),
(Join-Path $remotesDir "zrok\website\docs"),
(Join-Path $remotesDir "selfhosted\docusaurus\docs"),
(Join-Path $remotesDir "openziti\docusaurus\docs")
(Join-Path $remotesDir "openziti\docusaurus\docs"),
(Join-Path $remotesDir "platform\docusaurus\docs")
)
$targets = $potentialTargets | Where-Object { Test-Path $_ }

Expand Down Expand Up @@ -224,13 +223,16 @@ Write-Host " ZrokBranch: $ZrokBranch"
Write-Host " FrontdoorBranch: $FrontdoorBranch"
Write-Host " SelfhostedBranch: $SelfhostedBranch"
Write-Host " ZlanBranch: $ZlanBranch"
Write-Host " PlatformBranch: $PlatformBranch"
Write-Host " Clean: $Clean"
Write-Host " LintOnly: $LintOnly"
Write-Host " SkipLinkedDoc: $SkipLinkedDoc"
Write-Host " NoMinify: $NoMinify"
Write-Host " Qualifier: '$Qualifier'"
Write-Host " BuildMask: $BuildMask"
Write-Host " IS_VERCEL: $($env:IS_VERCEL)"
Write-Host " node: $(node --version 2>$null)"
Write-Host " yarn: $(yarn --version 2>$null)"

if ($Clean) {
Write-Host "CLEAN: removing _remotes contents (preserving package.json)"
Expand Down Expand Up @@ -264,13 +266,20 @@ $urlSelfhosted = Get-RepoUrl `

$urlZrok = "https://github.com/openziti/zrok.git" # public; no auth needed

$urlPlatform = Get-RepoUrl `
-DefaultHttpsUrl "https://bitbucket.org/netfoundry/platform-doc.git" `
-TokenEnvVar "BB_REPO_TOKEN_PLATFORM_DOC" `
-SshUrl "git@bitbucket.org:netfoundry/platform-doc.git" `
-UsernameEnvVar "BB_USERNAME"

# ─── CLONE / UPDATE REMOTES ───────────────────────────────────────────────────

Invoke-CloneOrUpdate $urlFrontdoor "frontdoor" $FrontdoorBranch
Invoke-CloneOrUpdate $urlSelfhosted "selfhosted" $SelfhostedBranch
Invoke-CloneOrUpdate $urlZitiDoc "openziti" $ZitiDocBranch
Invoke-CloneOrUpdate $urlZlan "zlan" $ZlanBranch
Invoke-CloneOrUpdate $urlZrok "zrok" $ZrokBranch
Invoke-CloneOrUpdate $urlPlatform "platform" $PlatformBranch

# Remove stale Docusaurus caches and build outputs from inside the cloned remotes.
# A leftover .docusaurus/ or build/ from a prior run can confuse the unified-doc build.
Expand Down
85 changes: 24 additions & 61 deletions unified-doc/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,19 @@ while [[ $# -gt 0 ]]; do
esac
done

# --- DEBUG CONFIG ---
echo "========================================"
echo "bd BUILD ENVIRONMENT DEBUG"
echo "BUILD CONFIGURATION"
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 BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC'"
echo "bd BRANCH_ZROK='$BRANCH_ZROK'"
echo "bd BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR'"
echo "bd BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED'"
echo "bd BRANCH_ZLAN='$BRANCH_ZLAN'"
echo "bd BRANCH_PLATFORM='$BRANCH_PLATFORM'"
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 " BRANCH_ZITI_DOC='$BRANCH_ZITI_DOC'"
echo " BRANCH_ZROK='$BRANCH_ZROK'"
echo " BRANCH_FRONTDOOR='$BRANCH_FRONTDOOR'"
echo " BRANCH_SELFHOSTED='$BRANCH_SELFHOSTED'"
echo " BRANCH_ZLAN='$BRANCH_ZLAN'"
echo " BRANCH_PLATFORM='$BRANCH_PLATFORM'"
echo " CLEAN=$CLEAN"
echo " IS_VERCEL='${IS_VERCEL:-}'"
echo " node: $(node --version 2>/dev/null || echo 'not found')"
echo " yarn: $(yarn --version 2>/dev/null || echo 'not found')"
echo "========================================"

script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -133,7 +118,6 @@ clone_or_update() {
local url="$1" dest="$2" branch="${3:-main}"
local target="$script_dir/_remotes/$dest"

echo "bd clone_or_update url='$url' dest='$dest' branch='$branch' target='$target' CLEAN='${CLEAN:-0}'"

# --- AUTHENTICATION LOGIC ---
case "$url" in
Expand Down Expand Up @@ -187,10 +171,8 @@ clone_or_update() {
;;
esac

echo "bd clone_or_update effective_url='${url//:*@/://[REDACTED]@}'"

if [ -d "$target/.git" ]; then
echo "bd existing repo detected; fetching branch '$branch'"
echo "Updating '$dest' @ '$branch'..."
git -C "$target" remote set-url origin "$url" 2>&1 || git -C "$target" remote add origin "$url" 2>&1 || true
if ! git -C "$target" fetch --depth 1 origin "$branch" 2>&1 \
|| ! git -C "$target" reset --hard FETCH_HEAD 2>&1; then
Expand All @@ -199,19 +181,17 @@ clone_or_update() {
git ls-remote --heads "$url" | awk '{print $2}' | sed 's|refs/heads/||'
exit 1
fi
echo "bd fetch+reset succeeded"
elif [ -d "$target" ]; then
echo "❌ ${target} exists but is not a git repo."
ls -la "$target" 2>&1 || true
exit 1
else
echo "bd cloning branch '$branch' -> '$target'"
echo "Cloning '$dest' @ '$branch'..."
if ! git clone --single-branch --branch "$branch" --depth 1 "$url" "$target" 2>&1; then
echo "❌ Clone failed. Available branches in ${url//:*@/://[REDACTED]@}:"
git ls-remote --heads "$url" | awk '{print $2}' | sed 's|refs/heads/||'
exit 1
fi
echo "bd clone succeeded"
fi
}

Expand Down Expand Up @@ -345,12 +325,8 @@ lint_docs() {
# =============================================================================
# MAIN EXECUTION
# =============================================================================
echo "bd DEBUG: scanning for git dirs under _remotes"
find "$script_dir/_remotes" -name .git -type d 2>&1 || true


if [ "${CLEAN:-0}" -eq 1 ]; then
echo "bd CLEAN=1 removing contents of _remotes (preserving package.json)"
echo "CLEAN: removing _remotes contents (preserving package.json)"
find "$script_dir/_remotes" -mindepth 1 -maxdepth 1 ! -name 'package.json' -exec rm -rf {} +
fi

Expand All @@ -361,17 +337,8 @@ clone_or_update "https://github.com/netfoundry/zlan.git"
clone_or_update "https://github.com/openziti/zrok.git" zrok "$BRANCH_ZROK"
clone_or_update "https://bitbucket.org/netfoundry/platform-doc.git" platform "$BRANCH_PLATFORM"

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 docusaurus build/ and .docusaurus/ dirs in remotes:"
find "$script_dir/_remotes" -type d \( -path "*/docusaurus/build" -o -path "*/docusaurus/.docusaurus" -o -path "*/website/build" -o -path "*/website/.docusaurus" \) 2>/dev/null || echo " (none found)"
echo "bd Cleaning stale build artifacts from remotes..."
echo "Cleaning stale build artifacts from remotes..."
find "$script_dir/_remotes" -type d \( -path "*/docusaurus/build" -o -path "*/docusaurus/.docusaurus" -o -path "*/website/build" -o -path "*/website/.docusaurus" \) -exec rm -rf {} + 2>/dev/null || true
echo "========================================"

echo "copying versionable docs locally..."
"${script_dir}/sync-versioned-remote.sh" zrok
Expand All @@ -397,30 +364,26 @@ pushd "${script_dir}" >/dev/null
yarn install

if [ "${CLEAN:-0}" -eq 1 ]; then
echo "bd CLEAN=1: running yarn clear to remove .docusaurus cache"
echo "CLEAN: clearing 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)
commit=$(git -C "${script_dir}" rev-parse --short HEAD 2>/dev/null || echo "unknown")
printf "%s\n%s\n" "$now" "$commit" > "${script_dir}/static/build-time.txt"
echo "BUILDING docs into: build${BUILD_QUALIFIER} at $now"

MINIFY_FLAG=""
if [ -n "${NO_MINIFY:-}" ]; then
MINIFY_FLAG="--no-minify"
fi
echo "NO_MINIFY flag: $MINIFY_FLAG"

echo "========================================"
echo "DOCUSAURUS BUILD"
echo "========================================"
echo " Output dir: build${BUILD_QUALIFIER}"
echo " Build mask: ${DOCUSAURUS_BUILD_MASK:-0xFF}"
echo " No-minify: ${NO_MINIFY:-false}"
echo "========================================"

yarn build $MINIFY_FLAG --out-dir "build${BUILD_QUALIFIER}" 2>&1
popd >/dev/null
2 changes: 1 addition & 1 deletion unified-doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@docusaurus/theme-mermaid": "^3.9.2",
"@hotjar/browser": "^1.0.9",
"@mdx-js/react": "^3.0.0",
"@netfoundry/docusaurus-theme": "^0.10.19",
"@netfoundry/docusaurus-theme": "^0.10.20",
"algoliasearch": "^5.36.0",
"asciinema-player": "^3.10.0",
"clsx": "^2.0.0",
Expand Down
8 changes: 4 additions & 4 deletions unified-doc/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2579,10 +2579,10 @@
hls.js "~1.6.6"
mux-embed "^5.8.3"

"@netfoundry/docusaurus-theme@^0.10.8":
version "0.10.19"
resolved "https://registry.yarnpkg.com/@netfoundry/docusaurus-theme/-/docusaurus-theme-0.10.19.tgz#7d353e11a08603f09b37c4d0f442edc678637f2b"
integrity sha512-saFPd3GJM+LJaOW3P3FJnwyRFDGaC7G389yM4HqfdusB8KTmaxLjTMcuE29zktMdgQer3wWTOyBYfqTBNxCpxA==
"@netfoundry/docusaurus-theme@^0.10.20":
version "0.10.20"
resolved "https://registry.yarnpkg.com/@netfoundry/docusaurus-theme/-/docusaurus-theme-0.10.20.tgz#e7b589b69aa24b81a4d7a81817e50adb93c35d59"
integrity sha512-LPkbGGIleX6y3OxNMw+o6BU1m+gV44uoHUGDOBd+JjymxWQ/Gze7N/p2zpvChhEMpkXMZeyXScpm+qjay7qbQA==
dependencies:
"@docsearch/react" "^3"
algoliasearch "^5"
Expand Down
Loading