diff --git a/docs/docs-participate/basics/index.md b/docs/docs-participate/basics/index.md deleted file mode 100644 index 1b6126e7eeb..00000000000 --- a/docs/docs-participate/basics/index.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Basics of Aztec -description: Learn the fundamentals of how the Aztec network works - addresses, wallets, fees, transactions, blocks, and bridging. -displayed_sidebar: participateSidebar ---- - -# Basics of Aztec - -This section covers the fundamental concepts you need to understand how Aztec works. Whether you're a user, token holder, or just curious about the technology, these pages explain the core ideas without requiring technical expertise. - -## What You'll Learn - -### [Addresses](/participate/basics/addresses) -Every account on Aztec has an address, but they work differently from Ethereum addresses. Learn how Aztec's private-by-design accounts create addresses that can receive funds even before the account exists. - -### [Wallets](/participate/basics/wallets) -Discover the wallets available for Aztec, how they differ from traditional crypto wallets, and what hardware wallet support looks like. - -### [Fees](/participate/basics/fees) -Understand how transaction fees work on Aztec. We use "mana" (similar to Ethereum's gas) and fees are paid in Fee Juice, which you get by bridging $AZTEC from Ethereum. - -### [Transactions](/participate/basics/transactions) -Learn about the unique transaction lifecycle on Aztec, including why transactions are proven on your device before being sent to the network. - -### [Blocks](/participate/basics/blocks) -Explore how blocks are produced on Aztec, the role of sequencers and provers, and how epochs organize proving work. - -### [Bridging](/participate/basics/bridging) -Understand how assets move between Ethereum (L1) and Aztec (L2), including the role of portal contracts and message passing. - ---- - -:::tip Want the technical details? -These pages focus on concepts for a general audience. For technical implementation details and code examples, see the [Developer Guides](/developers/overview). -::: diff --git a/docs/netlify.toml b/docs/netlify.toml index fe381e50fe2..45504962ec3 100644 --- a/docs/netlify.toml +++ b/docs/netlify.toml @@ -387,6 +387,12 @@ to = "/participate/:splat" status = 301 +# The basics overview repeated the Basics list of the Participate overview. +[[redirects]] + from = "/participate/basics" + to = "/participate" + status = 301 + # Network → Operate redirect [[redirects]] from = "/network/*" diff --git a/docs/netlify/edge-functions/markdown-negotiation.mjs b/docs/netlify/edge-functions/markdown-negotiation.mjs index 0069fe75263..0c51cb86671 100644 --- a/docs/netlify/edge-functions/markdown-negotiation.mjs +++ b/docs/netlify/edge-functions/markdown-negotiation.mjs @@ -32,10 +32,12 @@ function toMarkdownPath(pathname) { const toPagePath = (twinPath) => (twinPath === "/index.md" ? "/" : twinPath.slice(0, -3)); +// netlify dev's fetch wrapper re-resolves the path against the site, where `//host/...` names another host. +const namesAnotherHost = (url) => url.pathname.startsWith("//"); + /** A bare HEAD to this site that leaves redirects unfollowed; null for a path starting with `//`. */ async function probe(url) { - // netlify dev's fetch wrapper re-resolves the path against the site, where `//host/...` names another host. - if (url.pathname.startsWith("//")) return null; + if (namesAnotherHost(url)) return null; return fetch(url, { method: "HEAD", redirect: "manual", headers: { accept: "text/html", [SUBREQUEST_HEADER]: "subrequest" } }); } @@ -80,7 +82,7 @@ export default async (request, context) => { const accept = request.headers.get("accept") || ""; if (!prefersMarkdown(accept)) return; - if (FILE.test(url.pathname)) return; + if (FILE.test(url.pathname) || namesAnotherHost(url)) return; const markdownUrl = new URL(url.toString()); markdownUrl.pathname = toMarkdownPath(url.pathname); diff --git a/docs/netlify/edge-functions/migration-notes-range.mjs b/docs/netlify/edge-functions/migration-notes-range.mjs index a4b29889e92..2c7e0680266 100644 --- a/docs/netlify/edge-functions/migration-notes-range.mjs +++ b/docs/netlify/edge-functions/migration-notes-range.mjs @@ -27,6 +27,8 @@ export default async (request) => { if (query.from === null && query.to === null) return; const problem = queryProblem(query); if (problem) return badRange(problem); + // netlify dev's fetch wrapper re-resolves the path against the site, where `//host/...` names another host. + if (url.pathname.startsWith("//")) return; // Assigned, never resolved as a reference: a path that starts with `//` would name another host. const indexUrl = new URL(url.origin); @@ -44,4 +46,4 @@ export default async (request) => { return reply(200, renderRange(selection, url.origin + url.pathname.replace(/\.md$/, "")), "text/markdown"); }; -export const config = { path: "/*/migration_notes.md" }; +export const config = { path: "/*/migration_notes.md", onError: "bypass" }; diff --git a/docs/scripts/__tests__/markdown_negotiation.test.mts b/docs/scripts/__tests__/markdown_negotiation.test.mts index 0b063bec71c..cdb12a6a5c7 100644 --- a/docs/scripts/__tests__/markdown_negotiation.test.mts +++ b/docs/scripts/__tests__/markdown_negotiation.test.mts @@ -145,6 +145,14 @@ test("markdown negotiation is unchanged: its .md fetch is marked, so a retired p assert.equal(retired.probes[0]?.headers["x-markdown-negotiation"], "subrequest"); }); +test("a markdown request for a path naming another host fetches nothing and gets the normal response", async (t) => { + const { serve } = site(t); + for (const path of ["//other.example/page", "/\\other.example/page"]) { + const reply = await serve(path, { headers: { accept: "text/markdown" } }); + assert.deepEqual([reply.response, reply.probes], [undefined, []], path); + } +}); + test("the config turns on Netlify's error bypass, so an exception falls through to the normal response", () => { assert.deepEqual(config, { path: "/*", onError: "bypass" }); }); diff --git a/docs/scripts/__tests__/migration_ranges.test.mts b/docs/scripts/__tests__/migration_ranges.test.mts index 1b11350c36b..47faccea543 100644 --- a/docs/scripts/__tests__/migration_ranges.test.mts +++ b/docs/scripts/__tests__/migration_ranges.test.mts @@ -4,7 +4,7 @@ import os from "node:os"; import path from "node:path"; import { type TestContext, test } from "node:test"; import { compareVersions, parseVersion, renderRange, selectRange } from "../../src/migration_ranges.mjs"; -import serveRange from "../../netlify/edge-functions/migration-notes-range.mjs"; +import serveRange, { config as rangeConfig } from "../../netlify/edge-functions/migration-notes-range.mjs"; import { indexMigrationNotes, splitSections } from "../index_migration_notes.mjs"; const docs = path.join(import.meta.dirname, "../.."); @@ -155,6 +155,10 @@ test("the edge function serves a range, refuses a bad one, and otherwise steps a assert.equal(await serve("?from=5.2.0", null), undefined); fetched.length = 0; - await serveRange(new Request("https://docs.example//elsewhere.example/x/migration_notes.md?from=5.2.0")); - assert.deepEqual(fetched.map((u) => new URL(u).origin), ["https://docs.example"]); + assert.equal(await serveRange(new Request("https://docs.example//elsewhere.example/x/migration_notes.md?from=5.2.0")), undefined); + assert.deepEqual(fetched, []); +}); + +test("the edge function config turns on Netlify's error bypass, so an exception serves the static twin", () => { + assert.deepEqual(rangeConfig, { path: "/*/migration_notes.md", onError: "bypass" }); }); diff --git a/docs/scripts/__tests__/operate_sidebar.test.mts b/docs/scripts/__tests__/operate_sidebar.test.mts index 83e5ae403a3..6eb367d6cb0 100644 --- a/docs/scripts/__tests__/operate_sidebar.test.mts +++ b/docs/scripts/__tests__/operate_sidebar.test.mts @@ -43,10 +43,10 @@ function sidebarIds(file: string): Set { return ids; } -/** Doc ids under `root`/docs-operate that `root`/sidebars-operate.js does not list; `_` paths are partials. */ -function orphans(root: string): string[] { - const listed = sidebarIds(path.join(root, "sidebars-operate.js")); - const pagesDir = path.join(root, "docs-operate"); +/** Doc ids under `root`/`docsFolder` that `root`/`sidebar` does not list; `_` paths are partials. */ +function orphans(root: string, docsFolder = "docs-operate", sidebar = "sidebars-operate.js"): string[] { + const listed = sidebarIds(path.join(root, sidebar)); + const pagesDir = path.join(root, docsFolder); const pages = fs .readdirSync(pagesDir, { recursive: true, encoding: "utf8" }) .map((rel) => rel.split(path.sep).join("/")) @@ -74,6 +74,10 @@ test("every operate page is in its sidebar or listed in UNLISTED with a reason", ); }); +test("every participate page is in its sidebar", () => { + assert.deepEqual(orphans(docsDir, "docs-participate", "sidebars-participate.js"), [], "add each page to sidebars-participate.js"); +}); + test("ids, sidebars and partials follow Docusaurus for shapes the operate tree does not use yet", () => { assert.equal(docId("a/page.md", "---\r\nid: renamed\r\n---\r\n"), "a/renamed"); assert.equal(docId("a/page.md", '---\nid: "renamed #1" # note\n---\n'), "a/renamed #1"); diff --git a/docs/sidebars.js b/docs/sidebars.js deleted file mode 100644 index c63f0e83019..00000000000 --- a/docs/sidebars.js +++ /dev/null @@ -1,240 +0,0 @@ -// @ts-check - - -const sidebar = { - sidebar: [ - { - type: "html", - value: 'Overview', - className: "sidebar-title", - }, - { - type: "doc", - id: "developers/overview", - }, - { - type: "doc", - id: "developers/getting_started_on_local_network", - }, - { - type: "html", - value: 'Docs', - className: "sidebar-title", - }, - { - type: "autogenerated", - dirName: "developers/docs", - }, - { - type: "link", - label: "Get Inspired", - href: "https://github.com/AztecProtocol/horizon", - }, - ], - - "nodesSidebar": [ - { - "type": "html", - "value": "Getting Started", - "className": "sidebar-title" - }, - { - "type": "doc", - "id": "the_aztec_network/index" - }, - { - "type": "doc", - "id": "the_aztec_network/prerequisites" - }, - { - "type": "html", - "value": "" - }, - { - "type": "html", - "value": "Setup", - "className": "sidebar-title" - }, - { - "type": "doc", - "id": "the_aztec_network/setup/running_a_node" - }, - { - "type": "category", - "label": "Running a Sequencer", - "link": { - "type": "doc", - "id": "the_aztec_network/setup/sequencer_management" - }, - "items": [ - { - "type": "doc", - "id": "the_aztec_network/operation/sequencer_management/registering_sequencer" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/sequencer_management/become_a_staking_provider" - }, - { - "type": "doc", - "id": "the_aztec_network/setup/high_availability_sequencers" - } - ] - }, - { - "type": "doc", - "id": "the_aztec_network/setup/running_a_prover" - }, - { - "type": "doc", - "id": "the_aztec_network/setup/building_from_source" - }, - { - "type": "doc", - "id": "the_aztec_network/setup/bootnode_operation" - }, - { - "type": "doc", - "id": "the_aztec_network/setup/syncing_best_practices" - }, - { - "type": "html", - "value": "Operation", - "className": "sidebar-title" - }, - { - "type": "category", - "label": "Monitoring", - "link": { - "type": "doc", - "id": "the_aztec_network/operation/monitoring" - }, - "items": [ - { - "type": "category", - "label": "Setup Guides", - "items": [ - { - "type": "doc", - "id": "the_aztec_network/operation/otel_setup" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/prometheus_setup" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/grafana_setup" - } - ] - }, - { - "type": "doc", - "id": "the_aztec_network/operation/metrics_reference" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/monitoring_example_troubleshooting" - } - ] - }, - { - "type": "category", - "label": "Keystore Usage", - "link": { - "type": "doc", - "id": "the_aztec_network/operation/keystore/advanced_keystore_guide" - }, - "items": [ - { - "type": "doc", - "id": "the_aztec_network/operation/keystore/creating_keystores" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/keystore/storage_methods" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/keystore/advanced_patterns" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/keystore/troubleshooting" - } - ] - }, - { - "type": "category", - "label": "Sequencer Management", - "link": { - "type": "doc", - "id": "the_aztec_network/operation/sequencer_management/sequencer_management_overview" - }, - "items": [ - { - "type": "doc", - "id": "the_aztec_network/operation/sequencer_management/creating_and_voting_on_proposals" - }, - { - "type": "doc", - "id": "the_aztec_network/operation/sequencer_management/slashing_and_offenses" - }, - { - type: "doc", - id: "the_aztec_network/operation/sequencer_management/claiming_rewards", - }, - { - type: "doc", - id: "the_aztec_network/operation/sequencer_management/useful_commands", - }, - ], - }, - { - "type": "doc", - "id": "the_aztec_network/operation/operator_faq" - }, - { - "type": "html", - "value": "" - }, - { - "type": "html", - "value": "Reference", - "className": "sidebar-title" - }, - { - "type": "category", - "label": "Changelog", - "link": { - "type": "doc", - "id": "the_aztec_network/reference/changelog/changelog" - }, - "items": [ - { - "type": "doc", - "id": "the_aztec_network/reference/changelog/v2.0.2" - } - ] - }, - { - "type": "doc", - "id": "the_aztec_network/reference/cli_reference" - }, - { - "type": "doc", - "id": "the_aztec_network/reference/node_api_reference" - }, - { - "type": "doc", - "id": "the_aztec_network/reference/ethereum_rpc_reference" - }, - { - "type": "doc", - "id": "the_aztec_network/reference/glossary" - } - ] -}; - -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ -module.exports = sidebar;