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
30 changes: 30 additions & 0 deletions scripts/vercel-ignore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Vercel "Ignored Build Step" helper.
# Exit 0 = skip build, Exit 1 = build.
# Usage: scripts/vercel-ignore.sh <path> e.g. scripts/vercel-ignore.sh packages/

set -e

WATCH_PATH="$1"

if [ -z "$WATCH_PATH" ]; then
echo "usage: $0 <path>" >&2
exit 1
fi

# Vercel clones shallow with no 'origin' remote configured. Wire one up.
if ! git remote get-url origin >/dev/null 2>&1; then
git remote add origin "https://github.com/netfoundry/docusaurus-shared"
fi

git fetch origin main --depth=100

if git diff --quiet origin/main...HEAD -- "$WATCH_PATH"; then
echo "No changes under $WATCH_PATH vs origin/main -- skipping build."
exit 0
else
echo "Changes detected under $WATCH_PATH vs origin/main -- building."
exit 1
fi


8 changes: 4 additions & 4 deletions unified-doc/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,28 +446,28 @@ const config: Config = {
label: 'Edge Client API reference',
route: `/${routeBase('openziti')}/reference/developer/api/edge-client-api-reference`,
showNavLink: false,
configuration: {url: 'https://get.openziti.io/spec/client.yml', hideClientButton: true, hideTestRequestButton: true},
configuration: {url: 'https://get.openziti.io/spec/client.yml', hideClientButton: true, hideTestRequestButton: true, searchHotKey: 'i'},
} as ScalarOptions],
build(BUILD_FLAGS.OPENZITI) && ['@scalar/docusaurus', {
id: 'edge-management',
label: 'Edge Management API reference',
route: `/${routeBase('openziti')}/reference/developer/api/edge-management-api-reference`,
showNavLink: false,
configuration: {url: 'https://get.openziti.io/spec/management.yml', hideClientButton: true, hideTestRequestButton: true},
configuration: {url: 'https://get.openziti.io/spec/management.yml', hideClientButton: true, hideTestRequestButton: true, searchHotKey: 'i'},
} as ScalarOptions],
build(BUILD_FLAGS.PLATFORM) && ['@scalar/docusaurus', {
id: 'platform-api',
label: 'API reference',
route: `/${routeBase('platform')}/api-guides/openapi-reference`,
showNavLink: false,
configuration: {url: `${docsBase}console-api-spec.yaml`, hideClientButton: true, hideTestRequestButton: true},
configuration: {url: `${docsBase}console-api-spec.yaml`, hideClientButton: true, hideTestRequestButton: true, searchHotKey: 'i'},
} as ScalarOptions],
build(BUILD_FLAGS.FRONTDOOR) && ['@scalar/docusaurus', {
id: 'frontdoor-api',
label: 'API reference',
route: `/${routeBase('frontdoor')}/reference/api-reference`,
showNavLink: false,
configuration: {url: `${docsBase}frontdoor-api-spec.yaml`, hideClientButton: true, hideTestRequestButton: true},
configuration: {url: `${docsBase}frontdoor-api-spec.yaml`, hideClientButton: true, hideTestRequestButton: true, searchHotKey: 'i'},
} as ScalarOptions],
].filter(Boolean),
themeConfig: {
Expand Down
4 changes: 2 additions & 2 deletions unified-doc/src/pages/docs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function Home(): ReactNode {
<span style={{margin: '0 8px'}} />
<Link className="button button--secondary button--lg" to={useBaseUrl('/docs/frontdoor/intro')}>Frontdoor Docs</Link>
<span style={{margin: '0 8px'}} />
<Link className="button button--secondary button--lg" to={useBaseUrl('/docs/openziti/learn/introduction')}>OpenZiti Docs</Link>
<Link className="button button--secondary button--lg" to={useBaseUrl('/docs/openziti/intro')}>OpenZiti Docs</Link>
<span style={{margin: '0 8px'}} />
<Link className="button button--secondary button--lg" to={useBaseUrl('/docs/zlan/intro')}>zLAN Docs</Link>
</div>
Expand Down Expand Up @@ -85,7 +85,7 @@ export default function Home(): ReactNode {
Open-source zero-trust networking project and SDKs.
</div>
<div className="card__footer">
<Link className="button button--primary button--block" to={useBaseUrl('/docs/openziti/learn/introduction')}>Go to OpenZiti</Link>
<Link className="button button--primary button--block" to={useBaseUrl('/docs/openziti/intro')}>Go to OpenZiti</Link>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion unified-doc/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const products = [
logo: `${IMG}/openziti-sm-logo.svg`,
tag: 'Open Source',
accent: GREEN,
link: `${DOCS_BASE}openziti/learn/introduction`,
link: `${DOCS_BASE}openziti/intro`,
features: ['Community support', 'Full overlay mesh: controller, routers, and SDKs', 'Embed zero-trust in any application'],
description: 'The open-source zero-trust networking framework behind NetFoundry. Add zero trust to existing apps with tunnelers, or embed it directly with the SDK for the strongest posture.'
},
Expand Down
14 changes: 13 additions & 1 deletion unified-doc/src/theme/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const mapFooter = (p: string) => {

export default function LayoutWrapper(props: NetFoundryLayoutProps): ReactNode {
const {pathname} = useLocation();
const isApiPage = /(api-reference|openapi-reference)$/.test(pathname);
let starProps: StarUsProps | undefined;
if (matchPath(pathname, 'openziti')) {
starProps = {
Expand All @@ -39,8 +40,19 @@ export default function LayoutWrapper(props: NetFoundryLayoutProps): ReactNode {
const footerToShow = mapFooter(pathname);
return (
<NetFoundryLayout footerProps={footerToShow} starProps={starProps} >
{isApiPage && (
<div style={{
height: '40px',
display: 'flex',
alignItems: 'center',
padding: '0 1rem',
borderBottom: '1px solid var(--ifm-hr-border-color)',
background: 'var(--ifm-navbar-background-color)',
}}>
<button onClick={() => { if (typeof window !== 'undefined') window.history.back(); }} style={{ fontSize: '0.875rem', color: 'var(--ifm-color-primary)', textDecoration: 'none', background: 'none', border: 'none', cursor: 'pointer', padding: 0 }}>← Back to docs</button>
</div>
)}
{props.children}
</NetFoundryLayout>
);
}

Loading