Skip to content

Commit 7c29c31

Browse files
committed
conflict
2 parents d9bddac + dcb99bb commit 7c29c31

12 files changed

Lines changed: 111 additions & 91 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ jobs:
9999
DOCUSAURUS_URL: 'https://netfoundry.io'
100100
run: unified-doc/publish-unified-doc.sh -ds
101101

102+
- name: Upload build artifact
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: docusaurus-build-site
106+
path: unified-doc/build-site/
107+
102108
# check-links:
103109
# if: github.ref_name == 'main'
104110
# needs: publish-docs-from-container

packages/docusaurus-theme/css/layout.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ body,
77
flex-direction: column;
88
}
99

10+
html {
11+
scrollbar-gutter: stable;
12+
}
13+
1014
.main-wrapper > div {
1115
/* work around issue from docusaurus doc grow/shrinking based on content */
1216
width: 100%;
1317
max-width: var(--ziti-max-width);
14-
}
18+
}

packages/docusaurus-theme/css/legacy.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,11 @@ code {
19741974
background: var(--ziti-code-block-background-color);
19751975
color: var(--ziti-code-block-font-color);
19761976
border-color: var(--ziti-code-block-border-color);
1977+
<<<<<<< HEAD
19771978
white-space: pre;
1979+
=======
1980+
white-space: nowrap;
1981+
>>>>>>> main
19781982
}
19791983

19801984
code p {

packages/docusaurus-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netfoundry/docusaurus-theme",
3-
"version": "0.5.0",
3+
"version": "0.7.1",
44
"description": "NetFoundry Docusaurus theme with shared layout, footer, and styling",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",

packages/docusaurus-theme/src/components/NetFoundryHorizontalSection/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
flex-grow: 1;
44
flex-direction: column;
55
align-items: center;
6-
background-color: var(--ifm-background-color);
6+
background-color: var(--nf-section-bg, var(--ifm-background-color));
77
max-width: var(--ziti-max-width);
88
width: 100%;
99
}

packages/test-site/docs/formatting-demo.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,7 @@ A ReMark plugin translates imported GitHub admonitions to Docusaurus admonitions
164164
165165
> [!CAUTION]
166166
> <DetailsExample/>
167+
168+
## Wrapping of single tick code blocks
169+
170+
`This is a` `block of text` `that is composed` `entirely of backticked` `words to see` `what it looks` `like when it` `is rendered. it` `needs to be` `reallylong and you` `should look at` `it and resize` `the screen and` `make sure it` `always keeps looking` `correct.`

unified-doc/algolia-prod-crawler.json

Lines changed: 65 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,83 +13,80 @@ new Crawler({
1313
indexName: "nfdocs",
1414
pathsToMatch: ["https://netfoundry.io/docs/**"],
1515
recordExtractor: ({ $, helpers }) => {
16-
// priority order: deepest active sub list header -> navbar active item -> 'Documentation'
17-
const lvl0 =
18-
$(
19-
".menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active",
20-
)
21-
.last()
22-
.text() || "Documentation";
16+
// priority order: deepest active sub list header -> navbar active item -> 'Documentation'
17+
const lvl0 =
18+
$(
19+
".menu__link.menu__link--sublist.menu__link--active, .navbar__item.navbar__link--active",
20+
)
21+
.last()
22+
.text() || "Documentation";
2323

24-
const records = helpers.docsearch({
25-
recordProps: {
26-
lvl0: {
27-
selectors: "",
28-
defaultValue: lvl0,
29-
},
30-
lvl1: ["header h1", "article h1"],
31-
lvl2: "article h2",
32-
lvl3: "article h3",
33-
lvl4: "article h4",
34-
lvl5: "article h5, article td:first-child",
35-
lvl6: "article h6",
36-
content: "article p, article li, article td:last-child",
37-
},
38-
indexHeadings: false, // ends up with empty results?
39-
aggregateContent: true,
40-
recordVersion: "v3",
41-
},);
24+
const records = helpers.docsearch({
25+
recordProps: {
26+
lvl0: {
27+
selectors: "",
28+
defaultValue: lvl0,
29+
},
30+
lvl1: ["header h1", "article h1"],
31+
lvl2: "article h2",
32+
lvl3: "article h3",
33+
lvl4: "article h4",
34+
lvl5: "article h5, article td:first-child",
35+
lvl6: "article h6",
36+
content: "article p, article li, article td:last-child",
37+
},
38+
indexHeadings: false, // ends up with empty results?
39+
aggregateContent: false,
40+
recordVersion: "v3",
41+
});
4242

43-
return records.map((rec) => {
44-
rec.product = "unknown";
45-
if (rec.url_without_anchor.includes("/docs/frontdoor"))
46-
rec.product = "frontdoor";
47-
else if (rec.url_without_anchor.includes("/docs/openziti"))
48-
rec.product = "openziti";
49-
else if (rec.url_without_anchor.includes("/docs/onprem"))
50-
rec.product = "onprem";
51-
else if (rec.url_without_anchor.includes("/docs/zlan"))
52-
rec.product = "zlan";
53-
else if (rec.url_without_anchor.includes("/docs/zrok"))
54-
rec.product = "zrok";
55-
return rec;
56-
});
57-
},
58-
},
43+
return records.map((rec) => {
44+
rec.product = "unknown";
45+
46+
const u = rec.url_without_anchor || rec.url || "";
47+
const path = u.startsWith("http") ? new URL(u).pathname : u;
48+
49+
const m = path.match(/^\/docs\/([^\/]+)/);
50+
if (m) rec.product = m[1];
51+
52+
return rec;
53+
});
54+
},
55+
},
5956
{
6057
indexName: "netfoundry.io-docs-markdown",
6158
pathsToMatch: ["https://netfoundry.io/docs/**"],
6259
recordExtractor: ({ $, url, helpers }) => {
63-
const text = helpers.markdown("main");
64-
if (text === "") return [];
60+
const text = helpers.markdown("main");
61+
if (text === "") return [];
6562

66-
// Extract meta tag values. These are required for Docusaurus
67-
const language =
68-
$('meta[name="docsearch:language"]').attr("content") || "en";
69-
const version =
70-
$('meta[name="docsearch:version"]').attr("content") || "latest";
71-
const docusaurus_tag =
72-
$('meta[name="docsearch:docusaurus_tag"]').attr("content") || "";
63+
// Extract meta tag values. These are required for Docusaurus
64+
const language =
65+
$('meta[name="docsearch:language"]').attr("content") || "en";
66+
const version =
67+
$('meta[name="docsearch:version"]').attr("content") || "latest";
68+
const docusaurus_tag =
69+
$('meta[name="docsearch:docusaurus_tag"]').attr("content") || "";
7370

74-
return helpers.splitTextIntoRecords({
75-
text,
76-
baseRecord: {
77-
url,
78-
objectID: url,
79-
title: $("head > title").text(),
80-
lang: language, // Required for Docusaurus
81-
language, // Required for Docusaurus
82-
version: version.split(","), // in case there are multiple versions. Required for Docusaurus
83-
docusaurus_tag: docusaurus_tag // Required for Docusaurus
84-
.split(",")
85-
.map((tag) => tag.trim())
86-
.filter(Boolean),
71+
return helpers.splitTextIntoRecords({
72+
text,
73+
baseRecord: {
74+
url,
75+
objectID: url,
76+
title: $("head > title").text(),
77+
lang: language, // Required for Docusaurus
78+
language, // Required for Docusaurus
79+
version: version.split(","), // in case there are multiple versions. Required for Docusaurus
80+
docusaurus_tag: docusaurus_tag // Required for Docusaurus
81+
.split(",")
82+
.map((tag) => tag.trim())
83+
.filter(Boolean),
84+
},
85+
maxRecordBytes: 100000,
86+
orderingAttributeName: "part",
87+
});
8788
},
88-
maxRecordBytes: 100000,
89-
orderingAttributeName: "part",
90-
});
91-
},
92-
},
89+
},
9390
],
9491
initialIndexSettings: {
9592
nfdocs: {

unified-doc/build-docs.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ if [ "${CLEAN:-0}" -eq 1 ]; then
285285
fi
286286

287287
clone_or_update "https://bitbucket.org/netfoundry/zrok-connector.git" frontdoor develop
288-
clone_or_update "https://bitbucket.org/netfoundry/k8s-on-prem-installations.git" selfhosted full-rename
288+
clone_or_update "https://bitbucket.org/netfoundry/k8s-on-prem-installations.git" selfhosted main
289289
clone_or_update "https://github.com/openziti/ziti-doc.git" openziti main
290290
clone_or_update "https://github.com/netfoundry/zlan.git" zlan main
291291
clone_or_update "https://github.com/openziti/zrok.git" zrok main
@@ -296,32 +296,32 @@ echo "========================================"
296296
echo "bd Directories in _remotes:"
297297
ls -la "$script_dir/_remotes" 2>/dev/null || echo " (none)"
298298
echo "----------------------------------------"
299-
echo "bd Looking for build/ and .docusaurus/ dirs in remotes:"
300-
find "$script_dir/_remotes" -type d \( -name "build" -o -name ".docusaurus" \) 2>/dev/null || echo " (none found)"
299+
echo "bd Looking for docusaurus build/ and .docusaurus/ dirs in remotes:"
300+
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)"
301301
echo "bd Cleaning stale build artifacts from remotes..."
302-
find "$script_dir/_remotes" -type d \( -name "build" -o -name ".docusaurus" \) -exec rm -rf {} + 2>/dev/null || true
302+
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
303303
echo "========================================"
304304

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

308-
# --- STEP 1: LINT ---
308+
# --- LINT DOCS ---
309309
lint_docs
310310

311311
if [ "$LINT_ONLY" -eq 1 ]; then
312312
echo "🛑 --lint-only specified. Exiting before build."
313313
exit 0
314314
fi
315315

316-
# --- STEP 2: BUILD SDKs ---
316+
# --- BUILD OPENZITI SDK REFERENCE DOCS ---
317317
export SDK_ROOT_TARGET="${script_dir}/static/openziti/reference/developer/sdk"
318318
echo "creating openziti SDK target if necessary at: ${SDK_ROOT_TARGET}"
319319
mkdir -p "${SDK_ROOT_TARGET}"
320320

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

324-
# --- STEP 3: DOCUSAURUS BUILD ---
324+
# --- DOCUSAURUS BUILD ---
325325
pushd "${script_dir}" >/dev/null
326326
yarn install
327327

@@ -341,7 +341,8 @@ echo "bd output dir: build${BUILD_QUALIFIER}"
341341
echo "========================================"
342342

343343
now=$(date)
344-
echo "$now" > "${script_dir}/static/build-time.txt"
344+
commit=$(git -C "${script_dir}" rev-parse --short HEAD 2>/dev/null || echo "unknown")
345+
printf "%s\n%s\n" "$now" "$commit" > "${script_dir}/static/build-time.txt"
345346
echo "BUILDING docs into: build${BUILD_QUALIFIER} at $now"
346347

347348
MINIFY_FLAG=""

unified-doc/docusaurus.config.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import remarkGithubAdmonitionsToDirectives from "remark-github-admonitions-to-di
1313
import {pluginHotjar} from "@netfoundry/docusaurus-theme/node";
1414
import {PublishConfig} from 'src/components/docusaurus'
1515
import {zrokDocsPluginConfig} from "./_remotes/zrok/website/docusaurus-plugin-zrok-docs.ts";
16+
import {onpremRedirects} from "./_remotes/selfhosted/docusaurus/docusaurus-plugin-onprem-docs.ts";
1617

1718
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
1819
const frontdoor = `./_remotes/frontdoor`;
@@ -86,11 +87,11 @@ const REMARK_MAPPINGS = [
8687
{ from: '@openzitidocs', to: `${docsBase}openziti`},
8788
{ from: '@zrokdocs', to: `${docsBase}zrok`},
8889
{ from: '@static', to: docsBase},
89-
{ from: '/openziti/', to: `${docsBase}/openziti/` },
90-
{ from: '/frontdoor/', to: `${docsBase}/frontdoor/` },
91-
{ from: '/selfhosted/', to: `${docsBase}/selfhosted/` },
92-
{ from: '/zrok/', to: `${docsBase}/zrok/` },
93-
{ from: '/zlan/', to: `${docsBase}/zlan/` },
90+
{ from: '/openziti/', to: `${docsBase}${routeBase('openziti')}/` },
91+
{ from: '/frontdoor/', to: `${docsBase}${routeBase('frontdoor')}/` },
92+
{ from: '/selfhosted/', to: `${docsBase}${routeBase('selfhosted')}/` },
93+
{ from: '/zrok/', to: `${docsBase}${routeBase('zrok')}/` },
94+
{ from: '/zlan/', to: `${docsBase}${routeBase('zlan')}/` },
9495
];
9596

9697
console.log("CANONICAL URL : " + cfg.docusaurus.url);
@@ -349,6 +350,7 @@ const config: Config = {
349350
['@docusaurus/plugin-sitemap', { changefreq: "daily", priority: 0.8 }],
350351
[pluginHotjar, {}],
351352
['@docusaurus/plugin-google-tag-manager', {id: `openziti-gtm`, containerId: cfg.google.tag}],
353+
build(BUILD_FLAGS.SELFHOSTED) && onpremRedirects(routeBase('selfhosted')),
352354
].filter(Boolean),
353355
themeConfig: {
354356
docs: {

unified-doc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@docusaurus/theme-mermaid": "^3.9.2",
5454
"@hotjar/browser": "^1.0.9",
5555
"@mdx-js/react": "^3.0.0",
56-
"@netfoundry/docusaurus-theme": "^0.5.0",
56+
"@netfoundry/docusaurus-theme": "^0.7.0",
5757
"algoliasearch": "^5.36.0",
5858
"asciinema-player": "^3.10.0",
5959
"clsx": "^2.0.0",

0 commit comments

Comments
 (0)