mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-02 12:53:12 +00:00
Autogenerate sidebar
Also add intro to research section
This commit is contained in:
parent
c72dc2d62b
commit
e2f6fab9f0
10
docs/research/index.md
Normal file
10
docs/research/index.md
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
title: Research
|
||||
hide_table_of_contents: true
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
**Research and Studies**: protocol simulations and theoretical analysis to support the design
|
||||
of Waku protocols. The protocol definitions can be found on the [Vac RFC](https://rfc.vac.dev/) website.
|
||||
|
||||
**Benchmarks**: Results of implementations and engineering related benchmarks for Waku clients.
|
||||
@ -63,17 +63,25 @@ const repositories = [
|
||||
{
|
||||
baseUrl: 'https://api.github.com/repos/waku-org/nwaku/contents/docs/benchmarks',
|
||||
baseSavePath: '/docs/research/benchmarks/',
|
||||
prefixToRemove: 'docs/benchmarks/'
|
||||
prefixToRemove: "docs/benchmarks/",
|
||||
categoryFileContent: "{ \"label\": \"Benchmarks\", \"collapsed\": false }"
|
||||
},
|
||||
{
|
||||
baseUrl: 'https://api.github.com/repos/waku-org/research/contents/docs',
|
||||
baseSavePath: '/docs/research/research-and-studies/',
|
||||
prefixToRemove: 'docs/'
|
||||
prefixToRemove: "docs/",
|
||||
categoryFileContent: "{ \"label\": \"Research and Studies\", \"collapsed\": false }"
|
||||
}
|
||||
];
|
||||
|
||||
fs.rmSync('docs/research/', { recursive: true, force: true });
|
||||
repositories.forEach(repo => {
|
||||
fs.rmSync(path.join(__dirname, repo.baseSavePath), { recursive: true, force: true });
|
||||
});
|
||||
|
||||
repositories.forEach(repo => {
|
||||
fetchDirectoryContents(repo.baseUrl, repo.baseSavePath, repo.prefixToRemove);
|
||||
});
|
||||
fetchDirectoryContents(repo.baseUrl, repo.baseSavePath, repo.prefixToRemove, repo.categoryFileContent).then(() => {
|
||||
const dir = path.join(__dirname, repo.baseSavePath);
|
||||
fs.mkdirSync(dir, { recursive: true });
|
||||
fs.writeFileSync(path.join(dir, "_category_.json"), repo.categoryFileContent);
|
||||
});
|
||||
});
|
||||
|
||||
14
sidebars.js
14
sidebars.js
@ -87,18 +87,10 @@ const sidebars = {
|
||||
],
|
||||
research: [
|
||||
{
|
||||
type: "category",
|
||||
label: "Research and Studies",
|
||||
collapsed: false,
|
||||
items: ["research/research-and-studies/incentivisation"],
|
||||
},
|
||||
{
|
||||
type: "category",
|
||||
label: "Nwaku Benchmarks",
|
||||
collapsed: false,
|
||||
items: ["research/benchmarks/postgres-adoption"],
|
||||
type: 'autogenerated',
|
||||
dirName: 'research', // '.' means the current docs folder
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
module.exports = sidebars;
|
||||
module.exports = sidebars;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user