Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(config): style update to webkit scroll bars #1626

Closed
Closed
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
164 changes: 53 additions & 111 deletions antwar.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,155 +13,97 @@ module.exports = {
layout: () => require('./src/components/Site/Site.jsx').default,
paths: {
'/': {
title: "Home",
title: 'Home',
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content', false, /^\.\/.*\.md$/),
index: () => {
const index = require('./src/components/Splash/Splash.jsx').default;
index.title = 'webpack';
index.description = 'webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.';

return index;
},
index: () => require('./src/components/Splash/Splash.jsx').default
},
concepts: {
title: 'Concepts',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/concepts', false, /^\.\/.*\.md$/)
},
'get-started': {
redirects: {
'': '/guides/getting-started',
'install-webpack': '/guides/installation',
'why-webpack': '/guides/why-webpack',
}
configuration: {
title: 'Configuration',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/configuration', false, /^\.\/.*\.md$/)
},
api: {
title: "API",
layout: () => require('./src/components/Page/Page.jsx').default,
title: 'API',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/api', false, /^\.\/.*\.md$/),
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
},
redirects: {
'passing-a-config': 'configuration-types'
}
},
'api/plugins': {
title: "API Plugins",
layout: () => require('./src/components/Page/Page.jsx').default,
guides: {
title: 'Guides',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
content: () => require.context('./loaders/page-loader!./src/content/api/plugins', false, /^\.\/.*\.md$/),
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
},
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/guides', false, /^\.\/.*\.md$/),
redirects: {
'passing-a-config': 'configuration-types'
'code-splitting-import': '/guides/code-splitting',
'code-splitting-require': '/guides/code-splitting',
'code-splitting-async': '/guides/code-splitting',
'code-splitting-css': '/guides/code-splitting',
'code-splitting-libraries': '/guides/code-splitting',
'why-webpack': '/comparison',
'production-build': '/guides/production'
}
},
pluginsapi: {
title: 'API Plugin',
redirects: {
'': '/api/plugins',
'compiler': '/api/plugins/compiler',
'template': '/api/plugins/template'
},
hideInSidebar: true
},
concepts: {
title: "Concepts",
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/concepts', false, /^\.\/.*\.md$/),
plugins: {
title: 'Plugins',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
}
},
development: {
title: "Development",
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => require.context('./loaders/page-loader!./src/content/development', false, /^\.\/.*\.md$/),
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
}
},
plugins: {
title: "Plugin",
content: () => {
return combineContexts(
require.context('./loaders/page-loader!./src/content/plugins', false, /^\.\/.*\.md$/),
require.context('./loaders/page-loader!./generated/plugins', false, /^\.\/.*\.md$/)
);
},
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
},
layout: () => require('./src/components/Page/Page.jsx').default
}
},
loaders: {
title: "Loaders",
title: 'Loaders',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
layout: () => require('./src/components/Page/Page.jsx').default,
content: () => {
return combineContexts(
require.context('./loaders/page-loader!./src/content/loaders', false, /^\.\/.*\.md$/),
require.context('./loaders/page-loader!./generated/loaders', false, /^\.\/.*\.md$/)
);
},
},
guides: {
title: "Guides",
layout: () => require('./src/components/Page/Page.jsx').default,
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
content: () => require.context('./loaders/page-loader!./src/content/guides', false, /^\.\/.*\.md$/),
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
},
redirects: {
'code-splitting-import': '/guides/code-splitting',
'code-splitting-require': '/guides/code-splitting',
'code-splitting-async': '/guides/code-splitting',
'code-splitting-css': '/guides/code-splitting',
'code-splitting-libraries': '/guides/code-splitting',
'why-webpack': '/comparison',
'production-build': '/guides/production'
}
},
configuration: {
title: "Configuration",
layout: () => require('./src/components/Page/Page.jsx').default,
contribute: {
title: 'Contribute',
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
content: () => require.context('./loaders/page-loader!./src/content/configuration', false, /^\.\/.*\.md$/),
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
}
},
support: {
title: "Support",
layout: () => require('./src/components/Page/Page.jsx').default,
url: ({ sectionName, fileName }) => `/${sectionName}/${fileName}/`,
content: () => require.context('./loaders/page-loader!./src/content/support', false, /^\.\/.*\.md$/),
transform: (pages) => {
return _.sortBy(pages, (page) => page.file.sort)
}
},
vote: () => {
const page = require('./src/components/Vote/List.jsx').default;
page.title = 'Vote';

return page;
content: () => require.context('./loaders/page-loader!./src/content/contribute', false, /^\.\/.*\.md$/),
},
organization: () => {
const page = require('./src/components/Organization/Organization.jsx').default;

page.title = 'Organization';
vote: () => require('./src/components/Vote/Vote.jsx').default,
organization: () => require('./src/components/Organization/Organization.jsx').default,
'starter-kits': () => require('./src/components/StarterKits/StarterKits.jsx').default,

return page;
/*************************
Redirects for Old Content
*************************/
'get-started': {
hidden: true,
redirects: {
'': '/guides/getting-started',
'install-webpack': '/guides/installation',
'why-webpack': '/guides/why-webpack',
}
},
'guides/starter-kits': () => {
const page = require('./src/components/StarterKits/StarterKits.jsx').default;

page.title = 'Starter kits';

return page;
pluginsapi: {
hidden: true,
redirects: {
'': '/api/plugins',
'compiler': '/api/compiler',
'template': '/api/template'
}
}
}
};
1 change: 1 addition & 0 deletions loaders/page-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = function (source) {
const result = frontmatter(source);

result.attributes = result.attributes || {};
result.attributes.group = result.attributes.group || '-';
result.attributes.anchors = markdown().getAnchors(result.body);
result.attributes.contributors = (result.attributes.contributors || []).sort();
result.attributes.related = Array.isArray(result.attributes.related) ? result.attributes.related : [];
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Footer = () => (
<section className="footer__left">
<Link className="footer__link" to="/guides/getting-started/">Get Started</Link>
<Link className="footer__link" to="/organization/">Organization</Link>
<Link className="footer__link" to="/support/">Support</Link>
<Link className="footer__link" to="/starter-kits/">Starter Kits</Link>
<Link className="footer__link" to="/comparison/">Comparison</Link>
</section>

Expand Down
22 changes: 22 additions & 0 deletions src/components/Navigation/Links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"title": "Documentation",
"url": "concepts",
"children": [
{ "title": "Concepts", "url": "concepts" },
{ "title": "Configuration", "url": "configuration" },
{ "title": "API", "url": "api" },
{ "title": "Guides", "url": "guides" },
{ "title": "Loaders", "url": "loaders" },
{ "title": "Plugins", "url": "plugins" }
]
},
{
"title": "Contribute",
"url": "contribute"
},
{
"title": "Blog",
"url": "//medium.com/webpack"
}
]
Loading