diff --git a/.gitignore b/.gitignore index 27019fe0..67790bba 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ node_modules /docs/spec/**/*.md /docs/components/cli/ /docs/getting-started/configuration.md +/docs/getting-started/oidc.md /.idea/ diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 5abfe779..f558e35a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -24,6 +24,36 @@ const otdfctl = listRemote.createRepo("opentdf", "platform", process.env.OTDFCTL const javaSdkVersion = "0.11.1"; const gtmId = "GTM-MKRLN6NL"; +const platformDocsRef = "main"; +const platformDocsSourceUrl = new URL(`https://github.com/opentdf/platform/blob/${platformDocsRef}/docs/`); +const platformDocsRawUrl = `https://raw.githubusercontent.com/opentdf/platform/${platformDocsRef}/docs/`; +const platformDocs = { + "Configuring.md": { + id: "configuration", + title: "Configuration", + sidebarPosition: 20, + filename: "configuration.md", + }, + "OIDC.md": { + id: "oidc", + title: "OpenID Connect (OIDC)", + sidebarPosition: 21, + filename: "oidc.md", + }, +} as const; + +function rewritePlatformDocLinks(content: string): string { + return content.replace(/\]\((\.\.?\/[^)\s]+\.mdx?(?:[?#][^)\s]*)?)\)/g, (_link, target: string) => { + const sourceUrl = new URL(target, platformDocsSourceUrl); + const importedDoc = Object.entries(platformDocs).find( + ([filename]) => sourceUrl.pathname === new URL(filename, platformDocsSourceUrl).pathname, + )?.[1]; + + // Keep links between imported pages local; point other platform references at their source. + return `](${importedDoc ? `./${importedDoc.filename}${sourceUrl.search}${sourceUrl.hash}` : sourceUrl.href})`; + }); +} + const config: Config = { title: "OpenTDF", tagline: "Enabling secure data sharing through open, data-centric security", @@ -370,23 +400,21 @@ ${rawContent} [ "docusaurus-plugin-remote-content", { - // options here name: "platform-configuration", // used by CLI, must be path safe - sourceBaseUrl: - "https://raw.githubusercontent.com/opentdf/platform/main/docs/", // the base url for the markdown (gets prepended to all of the documents when fetching) + sourceBaseUrl: platformDocsRawUrl, outDir: "docs/getting-started", // the base directory to output to. - documents: ["Configuring.md"], // the file names to download + documents: Object.keys(platformDocs), modifyContent: (filename, content) => { - let updatedContent = content; + const doc = platformDocs[filename as keyof typeof platformDocs]; return { content: `--- -id: configuration -sidebar_position: 20 -title: Configuration +id: ${doc.id} +sidebar_position: ${doc.sidebarPosition} +title: ${doc.title} --- -${updatedContent}`, - filename: "configuration.md", +${rewritePlatformDocLinks(content)}`, + filename: doc.filename, }; }, }, diff --git a/src/components/landing/Standards.module.css b/src/components/landing/Standards.module.css index c16cd04d..0597e2a9 100644 --- a/src/components/landing/Standards.module.css +++ b/src/components/landing/Standards.module.css @@ -12,7 +12,7 @@ .grid { display: grid; - grid-template-columns: 1fr; + grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: center; } @@ -20,10 +20,12 @@ /* Diagram */ .diagramOrder { order: 2; + min-width: 0; } .contentOrder { order: 1; + min-width: 0; } .diagramWrap { diff --git a/src/css/custom.css b/src/css/custom.css index f2ca9441..f0b309ce 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -246,6 +246,12 @@ a[class*="embed_documentation_footer-"] { } } +@media (max-width: 359px) { + .footer__links { + grid-template-columns: 1fr; + } +} + /* R-10: Footer bottom bar stacks vertically on mobile */ @media (max-width: 768px) { .footer__bottom { @@ -556,6 +562,12 @@ html[data-theme='dark'] .navbar__items--right .navbar__item.navbar__link[href*=" background-color: rgba(255, 255, 255, 0.97); } + /* The closed sidebar sits to the right of the viewport. When the navbar + hides on scroll, its transform makes that sidebar widen the page. */ + .navbar:not(.navbar-sidebar--show) { + overflow-x: clip; + } + html[data-theme='dark'] .navbar { background-color: rgba(10, 12, 16, 0.97); }