|
| 1 | +const defaultSlugify = require("vuepress/lib/markdown/slugify"); |
| 2 | +const plugins = require("./plugins.js"); |
| 3 | +const pluginsChildren = []; |
| 4 | + |
| 5 | +plugins.forEach(plugin => { |
| 6 | + let readmePath = |
| 7 | + "/plugins/" + |
| 8 | + plugin.name.replace("/", "-").replace(/^@/, "") + |
| 9 | + ".md"; |
| 10 | + |
| 11 | + pluginsChildren.push([readmePath, plugin.name, 0]); |
| 12 | +}); |
| 13 | + |
1 | 14 | module.exports = {
|
2 | 15 | title: "Buidler",
|
3 |
| - description: "Buidler is a task runner for Ethereum smart contract developers.", |
| 16 | + description: |
| 17 | + "Buidler is a task runner for Ethereum smart contract developers.", |
4 | 18 | serviceWorker: false,
|
5 |
| - ga: 'UA-117668706-2', |
| 19 | + ga: "UA-117668706-2", |
6 | 20 | themeConfig: {
|
7 | 21 | logo: "/logo.svg",
|
8 | 22 | nav: [
|
9 | 23 | { text: "Home", link: "/" },
|
10 |
| - { text: "Why Buidler", link: "https://medium.com/nomic-labs-blog/buidler-compounding-value-for-ethereum-developers-425141a41b7b" }, |
11 |
| - { text: "Plugins", link: "/plugins/"}, |
12 |
| - { text: "Guides", link: "/guides/#getting-started" }, |
13 |
| - { text: "Documentation", link: "/documentation/" }, |
14 |
| - { text: "API", link: "/api/" }, |
15 |
| - { text: "Nomic Labs", link: "https://nomiclabs.io" } |
| 24 | + { text: "Buidler EVM", link: "/buidler-evm/" }, |
| 25 | + { text: "Plugins", link: "/plugins/" }, |
| 26 | + { text: "Documentation", link: "/getting-started/" }, |
| 27 | + { text: "API", link: "/api/" } |
16 | 28 | ],
|
17 | 29 | lastUpdated: true,
|
18 | 30 | repo: "nomiclabs/buidler",
|
19 | 31 | docsDir: "docs",
|
20 | 32 | docsBranch: "master",
|
21 | 33 | editLinkText: "Help us improve this page!",
|
22 | 34 | editLinks: true,
|
23 |
| - sidebar: { |
24 |
| - '/guides/': [{ |
| 35 | + sidebarDepth: 1, |
| 36 | + displayAllHeaders: true, |
| 37 | + sidebar: [ |
| 38 | + ["/getting-started/", "Getting Started", 1], |
| 39 | + ["/config/", "Configuration", 0], |
| 40 | + ["/buidler-evm/", "Buidler EVM", 0], |
| 41 | + { |
25 | 42 | title: "Guides",
|
| 43 | + url: "/guides/", |
26 | 44 | collapsable: false,
|
| 45 | + depth: 1, |
27 | 46 | children: [
|
28 |
| - '/guides/', |
29 |
| - 'testing', |
30 |
| - 'create-task', |
31 |
| - 'create-plugin', |
32 |
| - 'truffle-migration', |
33 |
| - 'scripts', |
34 |
| - 'typescript' |
| 47 | + ["/guides/truffle-migration.md", "Migrating from Truffle", 0], |
| 48 | + ["/guides/project-setup.md", "Setting up a project", 0], |
| 49 | + ["/guides/compile-contracts.md", "Compiling your contracts", 0], |
| 50 | + ["/guides/truffle-testing.md", "Testing with Web3.js & Truffle", 0], |
| 51 | + ["/guides/waffle-testing.md", "Testing with ethers.js & Waffle", 0], |
| 52 | + ["/guides/deploying.md", "Deploying your contracts", 0], |
| 53 | + ["/guides/scripts.md", "Writing scripts", 0], |
| 54 | + ["/guides/buidler-console.md", "Using the Buidler console", 0], |
| 55 | + ["/guides/create-task.md", "Creating a task", 0], |
| 56 | + ["/guides/ganache-tests.md", "Running tests with Ganache", 0], |
| 57 | + ["/guides/vscode-tests.md", "Running tests on VS Code", 0], |
| 58 | + ["/guides/typescript.md", "TypeScript support", 0] |
35 | 59 | ]
|
36 |
| - }], |
37 |
| - '/documentation/': { |
38 |
| - sidebar: 'auto' |
| 60 | + }, |
| 61 | + { |
| 62 | + title: "Advanced", |
| 63 | + collapsable: false, |
| 64 | + children: [ |
| 65 | + [ |
| 66 | + "/advanced/buidler-runtime-environment.html", |
| 67 | + "Buidler Runtime Environment (BRE)", |
| 68 | + 0 |
| 69 | + ], |
| 70 | + ["/advanced/building-plugins.html", "Building plugins", 0] |
| 71 | + ] |
| 72 | + }, |
| 73 | + { |
| 74 | + title: "Troubleshooting", |
| 75 | + collapsable: false, |
| 76 | + children: [ |
| 77 | + ["/troubleshooting/verbose-logging.html", "Verbose logging", 0], |
| 78 | + ["/troubleshooting/common-problems.html", "Common problems", 0], |
| 79 | + ["/errors/", "Error codes", 0] |
| 80 | + ] |
| 81 | + }, |
| 82 | + { |
| 83 | + title: "Plugins", |
| 84 | + collapsable: false, |
| 85 | + children: pluginsChildren |
39 | 86 | }
|
40 |
| - } |
| 87 | + ] |
41 | 88 | },
|
42 | 89 | head: [
|
43 |
| - ['meta ', { name: 'Cache-Control', content: 'public, max-age=0, must-revalidate' }] |
44 |
| - ] |
| 90 | + [ |
| 91 | + "meta ", |
| 92 | + { name: "Cache-Control", content: "public, max-age=0, must-revalidate" } |
| 93 | + ] |
| 94 | + ], |
| 95 | + markdown: { |
| 96 | + slugify: title => { |
| 97 | + const errorTitle = /(^BDLR\d+):/; |
| 98 | + |
| 99 | + const match = errorTitle.exec(title); |
| 100 | + |
| 101 | + if (match !== null) { |
| 102 | + return match[1]; |
| 103 | + } |
| 104 | + |
| 105 | + return defaultSlugify(title); |
| 106 | + } |
| 107 | + } |
45 | 108 | };
|
0 commit comments