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
12 changes: 11 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,18 @@ yarn workspace docs build
This command generates static content into the _build_ directory and can be served using any static
contents hosting service.

3. Verify build by serve a preview of the docs locally:
3. Verify build by serving a preview locally:

```sh
yarn workspace docs serve
```

## Production Testing

The site will be deployed at `noir-lang.org/docs/`. Test production configuration locally:

### Simple Test
```sh
yarn workspace docs production:serve
```
Access at: `http://localhost:3000/docs/`
22 changes: 20 additions & 2 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
tagline: 'The Universal ZK Circuit Language',
favicon: 'img/favicon.svg',
url: 'https://noir-lang.org',
baseUrl: '/',
baseUrl: process.env.ENV === 'dev' ? '/' : '/docs/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: process.env.ENV === 'dev' ? 'warn' : 'throw',
trailingSlash: false,
Expand All @@ -28,7 +28,7 @@ export default {
docs: {
path: process.env.ENV === 'dev' ? 'docs' : 'processed-docs',
sidebarPath: './sidebars.js',
routeBasePath: '/docs',
routeBasePath: '/',
remarkPlugins: [math],
rehypePlugins: [katex],
versions: {
Expand Down Expand Up @@ -149,12 +149,30 @@ export default {
name: 'resolve-react',
configureWebpack() {
return {
output: {
publicPath: process.env.ENV === 'dev' ? '/' : '/docs/',
},
optimization: {
innerGraph: false,
},
};
},
}),
// Create Netlify redirects only for production/staging
() => ({
name: 'netlify-redirects',
async postBuild({ outDir }) {
if (process.env.ENV !== 'dev') {
const { writeFileSync } = await import('fs');
const { join } = await import('path');
const redirectsContent = `# Netlify redirects for /docs/ routing
/docs/assets/* /assets/:splat 200
/docs/img/* /img/:splat 200
/docs/* /:splat 200`;
writeFileSync(join(outDir, '_redirects'), redirectsContent);
}
},
}),
[
'docusaurus-plugin-typedoc',
{
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"clean": "rm -rf ./processed-docs ./processed-docs-cache ./build",
"version::stables": "ts-node ./scripts/setStable.ts",
"serve": "serve build",
"production:serve": "mkdir -p temp-serve/docs && cp -r build/* temp-serve/docs/ && serve temp-serve -l 3000 && rm -rf temp-serve",
"swizzle": "docusaurus swizzle",
"cut_version": "yarn version::stables && ./scripts/cut_version.sh"
},
Expand Down
44 changes: 0 additions & 44 deletions docs/src/pages/index.jsx

This file was deleted.

Loading