+
+
+
+ View on Open Collective
+
-
-
-
-
-
-
-
-
+
+
-
-
+
+ {TIERS.map(tier => (
+
+ ))}
+
+
+
-
- >
+
+
);
}
diff --git a/layouts/Sponsors/index.module.css b/layouts/Sponsors/index.module.css
index 7236c009..e0418369 100644
--- a/layouts/Sponsors/index.module.css
+++ b/layouts/Sponsors/index.module.css
@@ -1,12 +1,5 @@
@reference "../../styles/index.css";
-.page {
- @apply bg-white
- text-neutral-900
- dark:bg-neutral-950
- dark:text-white;
-}
-
.container {
@apply mx-auto
max-w-7xl
diff --git a/pages/about/branding.md b/pages/about/branding.md
index eda3aca4..a45f6701 100644
--- a/pages/about/branding.md
+++ b/pages/about/branding.md
@@ -1,3 +1,7 @@
+---
+authors: avivkeller
+---
+
# Branding of webpack
Here you can find **webpack** project brand guidelines and assets. Official artwork is maintained in the OpenJS Foundation [artwork repository](https://github.com/openjs-foundation/artwork/tree/main/projects/webpack).
diff --git a/pages/docs/index.md b/pages/docs/index.md
new file mode 100644
index 00000000..5568faad
--- /dev/null
+++ b/pages/docs/index.md
@@ -0,0 +1,3 @@
+# Documentation
+
+STUB
diff --git a/pages/site.json b/pages/site.json
index e692df9a..f4052844 100644
--- a/pages/site.json
+++ b/pages/site.json
@@ -13,8 +13,8 @@
"text": "Blog"
},
{
- "link": "/api/v5.x",
- "text": "API"
+ "link": "/docs",
+ "text": "Docs"
},
{
"link": "/about/sponsors",
@@ -26,7 +26,6 @@
"target": "_blank"
}
],
- "sidebar": [],
"footer": {
"socialLinks": [
{
@@ -54,21 +53,17 @@
"text": "Getting Started",
"link": "/guides/getting-started"
},
- {
- "text": "Guides",
- "link": "/guides"
- },
{
"text": "Concepts",
- "link": "/concepts"
+ "link": "/guides/getting-started/concepts"
},
{
- "text": "Configuration",
- "link": "/configuration"
+ "text": "Guides",
+ "link": "/guides"
},
{
"text": "API",
- "link": "/api/v5.x"
+ "link": "/docs/api/v5.x"
}
]
},
@@ -77,11 +72,11 @@
"links": [
{
"text": "Loaders",
- "link": "/loaders"
+ "link": "/docs/loaders"
},
{
"text": "Plugins",
- "link": "/plugins"
+ "link": "/docs/plugins"
},
{
"text": "Awesome webpack",
diff --git a/pages/site.mjs b/pages/site.mjs
index 5da7d15a..74f3a87a 100644
--- a/pages/site.mjs
+++ b/pages/site.mjs
@@ -1,18 +1,40 @@
-import { sidebar as _sidebar } from './site.json' with { type: 'json' };
-import loaders from './loaders/site.json' with { type: 'json' };
-import plugins from './plugins/site.json' with { type: 'json' };
-import contribute from './about/governance/site.json' with { type: 'json' };
+import loaders from './docs/loaders/site.json' with { type: 'json' };
+import plugins from './docs/plugins/site.json' with { type: 'json' };
+import governance from './about/governance/site.json' with { type: 'json' };
+import versions from '../versions.json' with { type: 'json' };
+import { major } from 'semver';
export * from './site.json' with { type: 'json' };
-export const sidebar = [
- ..._sidebar,
- {
- groupName: 'Loaders & Plugins',
- items: [...loaders.sidebar, ...plugins.sidebar],
- },
- {
- groupName: 'About',
- items: contribute.sidebar,
- },
-];
+export const sidebar = {
+ about: [
+ {
+ groupName: 'Get Involved',
+ items: [
+ { link: '/about/branding', label: 'Branding' },
+ { link: '/about/sponsors', label: 'Sponsors' },
+ {
+ link: 'https://github.com/webpack/webpack/blob/main/CONTRIBUTING.md',
+ label: 'Contribute',
+ },
+ ],
+ },
+ ...governance.sidebar,
+ ],
+ docs: [
+ {
+ groupName: 'Main Packages',
+ items: [
+ {
+ label: 'webpack',
+ items: versions.map(v => ({
+ label: `webpack ${v}`,
+ link: `/docs/api/v${major(v)}.x`,
+ })),
+ },
+ ],
+ },
+ ...loaders.sidebar,
+ ...plugins.sidebar,
+ ],
+};
diff --git a/scripts/html/doc-kit.config.mjs b/scripts/html/doc-kit.config.mjs
index 8c63397d..d5494952 100644
--- a/scripts/html/doc-kit.config.mjs
+++ b/scripts/html/doc-kit.config.mjs
@@ -8,7 +8,7 @@ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
const VERSION = process.env.VERSION;
const MAJOR_VERSION = VERSION ? `v${major(VERSION)}.x` : undefined;
-const URL_PATH = VERSION ? `/api/${MAJOR_VERSION}` : '/';
+const URL_PATH = VERSION ? `/docs/api/${MAJOR_VERSION}` : '/';
const ORIGIN = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
@@ -29,8 +29,8 @@ export default {
repository: 'webpack/webpack',
version: VERSION,
input: [`${INPUT_DIR}/**/*.md`],
- ignore: VERSION ? [] : ['./pages/api/**/*.md'],
- output: VERSION ? `./out/api/${MAJOR_VERSION}` : './out',
+ ignore: VERSION ? [] : ['./pages/docs/api/**/*.md'],
+ output: VERSION ? `./out/docs/api/${MAJOR_VERSION}` : './out',
baseURL: BASE_URL,
},
threads: 1,
@@ -46,6 +46,8 @@ export default {
useAbsoluteURLs: true,
remoteConfigUrl: null,
title: VERSION ? `Webpack ${MAJOR_VERSION} Documentation` : 'Webpack',
+ editURL:
+ 'https://github.com/webpack/webpack-doc-kit/blob/main/pages/{path}.md',
head: {
meta: [
{
@@ -72,6 +74,7 @@ export default {
'#theme/site': SITE_MODULE,
'#theme/Sidebar': join(ROOT, 'components/SideBar.jsx'),
+ '#theme/Metabar': join(ROOT, 'components/MetaBar/index.jsx'),
'#theme/sponsors': join(ROOT, 'generated/sponsors.json'),
'#theme/Layout': join(ROOT, 'components/Layout.jsx'),
'#theme/Navigation': join(ROOT, 'components/NavBar.jsx'),
diff --git a/scripts/markdown/api.mjs b/scripts/markdown/api.mjs
index c8402e5f..93cf4572 100644
--- a/scripts/markdown/api.mjs
+++ b/scripts/markdown/api.mjs
@@ -12,7 +12,7 @@ const generate = async packageDir => {
const app = await Application.bootstrapWithPlugins({
entryPoints: [join(packageDir, 'types.d.ts')],
- out: join('pages', 'api', `v${major(version)}.x`),
+ out: join('pages', 'docs', 'api', `v${major(version)}.x`),
publicPath: `/api/v${major(version)}.x/`,
plugin: [
diff --git a/scripts/markdown/governance.mjs b/scripts/markdown/governance.mjs
index c2184239..305fb45b 100644
--- a/scripts/markdown/governance.mjs
+++ b/scripts/markdown/governance.mjs
@@ -11,7 +11,7 @@ const BASE_HEADERS = {
// Maps source filenames in webpack/governance repo to their output slug and sidebar label.
// Insertion order determines sidebar order, this could be changed as per need.
const FILE_MAP = {
- 'README.md': { output: 'index', label: 'Governance Overview' },
+ 'README.md': { output: 'index', label: 'Overview' },
'CHARTER.md': { output: 'charter', label: 'Charter' },
'MEMBER_EXPECTATIONS.md': {
output: 'member-expectations',
@@ -65,7 +65,13 @@ const results = await Promise.all(
return null;
}
- const content = `---\nsource: ${url}\n---\n\n${rewriteLinks(await res.text())}`;
+ let body = rewriteLinks(await res.text());
+
+ // Some governance docs (e.g. MEMBER_EXPECTATIONS.md) have no H1, which the
+ // site derives the page title from — fall back to the sidebar label.
+ if (!/^# /m.test(body)) body = `# ${label}\n\n${body}`;
+
+ const content = `---\nsource: ${url}\n---\n\n${body}`;
await writeFile(join(outputDir, `${output}.md`), content, 'utf8');
console.log(`Fetched: ${source} -> ${output}.md`);
return { output, label };
@@ -77,7 +83,7 @@ const fetched = results.filter(Boolean);
const siteJson = {
sidebar: [
{
- label: 'Governance',
+ groupName: 'Governance',
items: fetched.map(({ output, label }) => ({
link: `/about/governance/${output}`,
label,
diff --git a/scripts/markdown/readmes.mjs b/scripts/markdown/readmes.mjs
index f5144b1a..2d516afb 100644
--- a/scripts/markdown/readmes.mjs
+++ b/scripts/markdown/readmes.mjs
@@ -76,10 +76,10 @@ const processRepos = async (repos, { label, basePath, outputDir }) => {
const siteJson = {
sidebar: [
{
- label,
+ groupName: label,
items: fetched.map(name => ({
link: `${basePath}/${name}`,
- label: name.replace(/-(?:loader|plugin)$/, ''),
+ label: name.replace(/-(?:webpack-)?(?:loader|plugin)$/, ''),
})),
},
],
@@ -103,14 +103,14 @@ await Promise.all(
runLoaders &&
processRepos(loaders, {
label: 'Loaders',
- basePath: '/loaders',
- outputDir: join(root, 'pages/loaders'),
+ basePath: '/docs/loaders',
+ outputDir: join(root, 'pages/docs/loaders'),
}),
runPlugins &&
processRepos(plugins, {
label: 'Plugins',
- basePath: '/plugins',
- outputDir: join(root, 'pages/plugins'),
+ basePath: '/docs/plugins',
+ outputDir: join(root, 'pages/docs/plugins'),
}),
].filter(Boolean)
);