b6df383584
* Rawer landing page - Angular, clean docs styling inspired by Oxide - zero all border-radius globally (kill rounded corners) - sharp code blocks with subtle border - callouts: left-border accent instead of rounded pill - clean table grid lines, sharp search box and MUI buttons - tighter heading letter-spacing (-0.02em) - flat left-border sidebar active item instead of background blob * Add JetBrains Mono for headings/sidebar, push Oxide styling further - import JetBrains Mono via Google Fonts - apply mono font to headings, sidebar, nav bar, search, table headers - darken background (#181C1E), muted body text, h2 bottom border - subtle background tint on active sidebar item - inline code: background-only (no border), monospace table headers - fix active sidebar item font size (scope separator label rule) * Rework docs landing page: hero, ASCII cards, SDKs, get started - add hero section with subtitle covering all doc areas - replace PNG vector illustrations with ASCII art in primary green - add SDKs section with Rust and TypeScript links - add get started section: What is the Mixnet, Send a message, Run a node - add footer links to GitHub and Matrix - fix nav dropdown font (button + ul selectors) - add landing card hover style * Self-host JetBrains Mono, refine landing page - replace Google Fonts import with local @font-face (woff2) - add font files + OFL license to public/fonts/ - remove redundant "Nym Docs" hero heading (already in nav) - drop quick-links pills section - fix SDK box borders (negative margin collapse) - rewrite footer as simple link row (GitHub, Matrix, nym.com) * Light mode styling, dark-mode diagram invert, click-to-expand images - add full light mode CSS: pale grey bg, darker green links, mono fonts - invert diagram images in dark mode with mix-blend-mode: lighten - add click-to-expand overlay for content images - revert mermaid diagrams back to original PNGs * Fix Lychee config for fonts * Make light mode green darker * Animate landing page ASCII art, remove architecture diagram - Network: animated packet traversal through gw_e → M1/M2/M3 → gw_ex with diagonal cross-connections showing mixing paths - Developers: typewriter effect with blinking cursor - Operators: looping progress bar with continuously incrementing packet count - APIs: staged line-by-line response reveal - Remove architecture overview PNG from network/architecture.mdx * Small copy change to SDK headers * Fix links
184 lines
5.9 KiB
TypeScript
184 lines
5.9 KiB
TypeScript
import React from "react";
|
|
import { DocsThemeConfig, useConfig } from "nextra-theme-docs";
|
|
// import { Footer } from "./components/footer";
|
|
import { Matrix } from "./components/matrix-link";
|
|
import { Explorer } from "./components/explorer-link";
|
|
import { useRouter } from "next/router";
|
|
|
|
const config: DocsThemeConfig = {
|
|
head: function useHead() {
|
|
const config = useConfig();
|
|
const { route } = useRouter();
|
|
const url = process.env.NEXT_PUBLIC_SITE_URL;
|
|
const image = url + "/images/Nym_meta_Image.png";
|
|
const favicon = url + "/favicon.svg";
|
|
|
|
const defaultDescription =
|
|
"Nym is a privacy platform. It provides strong network-level privacy against sophisticated end-to-end attackers, and anonymous access control using blinded, re-randomizable, decentralized credentials.";
|
|
|
|
// Frontmatter-first description
|
|
const description = config.frontMatter.description || defaultDescription;
|
|
|
|
const baseTitle = config.frontMatter.title || config.title || "";
|
|
const title =
|
|
route === "/"
|
|
? "Nym Docs: Privacy Network Documentation"
|
|
: baseTitle.includes("| Nym Docs")
|
|
? baseTitle
|
|
: `${baseTitle} | Nym Docs`;
|
|
|
|
const pageUrl = `${url}${route}`;
|
|
|
|
// Frontmatter fields
|
|
const section = config.frontMatter.section || "";
|
|
const lastUpdated = config.frontMatter.lastUpdated || "";
|
|
const schemaType = config.frontMatter.schemaType || "TechArticle";
|
|
|
|
// JSON-LD structured data
|
|
const org = {
|
|
"@id": "https://nym.com/#org",
|
|
"@type": "Organization",
|
|
name: "Nym Technologies SA",
|
|
url: "https://nym.com",
|
|
logo: {
|
|
"@id": "https://nym.com/#logo",
|
|
"@type": "ImageObject",
|
|
url: "https://nym.com/apple-touch-icon.png",
|
|
},
|
|
sameAs: ["https://x.com/nymproject", "https://github.com/nymtech"],
|
|
};
|
|
|
|
const website = {
|
|
"@id": "https://nym.com/docs#website",
|
|
"@type": "WebSite",
|
|
name: "Nym Docs",
|
|
url: "https://nym.com/docs",
|
|
publisher: { "@id": "https://nym.com/#org" },
|
|
};
|
|
|
|
const webpage = {
|
|
"@id": `${pageUrl}#webpage`,
|
|
"@type": "WebPage",
|
|
url: pageUrl,
|
|
name: title,
|
|
description: description,
|
|
inLanguage: "en",
|
|
isPartOf: { "@id": "https://nym.com/docs#website" },
|
|
breadcrumb: { "@id": `${pageUrl}#breadcrumb` },
|
|
potentialAction: { "@type": "ReadAction", target: pageUrl },
|
|
};
|
|
|
|
const articleSchema: Record<string, any> = {
|
|
"@id": `${pageUrl}#article`,
|
|
"@type": schemaType,
|
|
...(schemaType === "HowTo"
|
|
? { name: baseTitle }
|
|
: { headline: baseTitle }),
|
|
description: description,
|
|
url: pageUrl,
|
|
author: { "@id": "https://nym.com/#org" },
|
|
publisher: { "@id": "https://nym.com/#org" },
|
|
mainEntityOfPage: { "@id": `${pageUrl}#webpage` },
|
|
...(lastUpdated && {
|
|
datePublished: lastUpdated,
|
|
dateModified: lastUpdated,
|
|
}),
|
|
};
|
|
|
|
const pathParts = route.split("/").filter(Boolean);
|
|
const breadcrumb = {
|
|
"@id": `${pageUrl}#breadcrumb`,
|
|
"@type": "BreadcrumbList",
|
|
itemListElement: pathParts.map((part: string, i: number) => ({
|
|
"@type": "ListItem",
|
|
position: i + 1,
|
|
name:
|
|
config.frontMatter.breadcrumbLabel && i === pathParts.length - 1
|
|
? config.frontMatter.breadcrumbLabel
|
|
: part.charAt(0).toUpperCase() + part.slice(1).replace(/-/g, " "),
|
|
item: `${url}/${pathParts.slice(0, i + 1).join("/")}`,
|
|
})),
|
|
};
|
|
|
|
const schema = {
|
|
"@context": "https://schema.org",
|
|
"@graph": [org, website, webpage, articleSchema, breadcrumb],
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<title>{title}</title>
|
|
<meta name="author" content="Nym" />
|
|
<link rel="canonical" href={pageUrl} />
|
|
<link rel="icon" href={favicon} type="image/svg+xml" />
|
|
<meta name="description" content={description} />
|
|
<meta property="og:title" content={title} />
|
|
<meta property="og:site_name" content="Nym docs" />
|
|
<meta property="og:description" content={description} />
|
|
<meta property="og:image" content={image} />
|
|
<meta property="og:type" content="article" />
|
|
<meta property="og:url" content={pageUrl} />
|
|
<meta property="og:image:width" content="1200" />
|
|
<meta property="og:image:height" content="630" />
|
|
{section && <meta property="article:section" content={section} />}
|
|
{lastUpdated && (
|
|
<meta property="article:modified_time" content={lastUpdated} />
|
|
)}
|
|
<meta property="twitter:title" content={title} />
|
|
<meta property="twitter:description" content={description} />
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
<meta property="twitter:image" content={image} />
|
|
<meta name="twitter:site" content="@nymproject" />
|
|
<meta name="twitter:site:domain" content={url} />
|
|
<meta name="twitter:url" content={pageUrl} />
|
|
<meta name="apple-mobile-web-app-title" content="Nym docs" />
|
|
<script
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
|
|
/>
|
|
</>
|
|
);
|
|
},
|
|
logo: <span style={{ fontFamily: "var(--font-mono)", fontSize: "1.1rem", fontWeight: 700 }}>Nym Docs</span>,
|
|
project: {
|
|
link: "https://github.com/nymtech/nym",
|
|
},
|
|
docsRepositoryBase:
|
|
"https://github.com/nymtech/nym/tree/develop/documentation/docs/",
|
|
// footer: {
|
|
// text: Footer,
|
|
// },
|
|
darkMode: true,
|
|
primaryHue: 135,
|
|
primarySaturation: 64,
|
|
nextThemes: {
|
|
defaultTheme: "dark",
|
|
},
|
|
sidebar: {
|
|
defaultMenuCollapseLevel: 1,
|
|
autoCollapse: true,
|
|
},
|
|
|
|
navbar: {
|
|
extraContent: (
|
|
<>
|
|
<Explorer />
|
|
<Matrix />
|
|
</>
|
|
),
|
|
},
|
|
toc: {
|
|
float: false,
|
|
component: null,
|
|
},
|
|
editLink: {
|
|
component: null, // remove element
|
|
},
|
|
feedback: {
|
|
content: null, // remove element
|
|
},
|
|
// gitTimestamp: TODO
|
|
};
|
|
|
|
export default config;
|