Skip to content

Commit fa884eb

Browse files
committed
Test including docs from other repositories, while keeping those docs in their current repositories.
1 parent e5a5e92 commit fa884eb

5 files changed

Lines changed: 109 additions & 30 deletions

File tree

‎.github/workflows/test-deploy.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
# Allow running this workflow manually from the Actions tab
1111
workflow_dispatch:
12-
12+
1313
defaults:
1414
run:
1515
shell: bash
@@ -23,10 +23,17 @@ jobs:
2323
name: Test deployment
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v4
26+
- name: Checkout Docusaurus site
27+
uses: actions/checkout@v4
2728
with:
2829
fetch-depth: 0
2930

31+
- name: Checkout TSC faqs
32+
uses: actions/checkout@v4
33+
with:
34+
repository: fairpm/tsc
35+
path: external/tsc/faq
36+
3037
- uses: actions/setup-node@v4
3138
with:
3239
node-version: 20

‎docs/docusaurus.config.js‎

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// See: https://docusaurus.io/docs/api/docusaurus-config
66

77
import {themes as prismThemes} from 'prism-react-renderer';
8+
import navbarItems from './navbarItems.js';
9+
import plugins from './plugins.js';
810

911
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
1012

@@ -80,34 +82,7 @@ const config = {
8082
// alt: 'FAIR Logo',
8183
// src: 'img/logo.svg',
8284
// },
83-
items: [
84-
{
85-
type: 'docSidebar',
86-
sidebarId: 'tutorialSidebar',
87-
position: 'left',
88-
label: 'Docs',
89-
},
90-
{
91-
to: '/blog',
92-
label: 'Blog',
93-
position: 'left'
94-
},
95-
{
96-
to: 'docs/contributing',
97-
label: 'Get involved',
98-
position: 'left'
99-
},
100-
{
101-
href: 'https://github.com/fairpm/docs',
102-
label: 'GitHub',
103-
position: 'right',
104-
},
105-
{
106-
href: 'https://fair.pm/',
107-
label: 'fair.pm',
108-
position: 'right',
109-
},
110-
],
85+
items: navbarItems,
11186
},
11287
footer: {
11388
style: 'dark',
@@ -167,6 +142,8 @@ const config = {
167142
darkTheme: prismThemes.dracula,
168143
},
169144
}),
145+
146+
plugins: plugins,
170147
};
171148

172149
export default config;

‎docs/navbarItems.js‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @ts-check
2+
3+
4+
const navbarItems = [
5+
{
6+
type: 'docSidebar',
7+
sidebarId: 'tutorialSidebar',
8+
position: 'left',
9+
label: 'Docs',
10+
},
11+
{
12+
to: '/blog',
13+
label: 'Blog',
14+
position: 'left'
15+
},
16+
{
17+
to: 'docs/contributing',
18+
label: 'Get involved',
19+
position: 'left'
20+
},
21+
{
22+
href: 'https://github.com/fairpm/docs',
23+
label: 'GitHub',
24+
position: 'right',
25+
},
26+
{
27+
href: 'https://fair.pm/',
28+
label: 'fair.pm',
29+
position: 'right',
30+
},
31+
];
32+
33+
navbarItems.push({
34+
type: 'docSidebar',
35+
sidebarId: 'tscSidebar',
36+
docsPluginId: 'tsc',
37+
position: 'left',
38+
label: 'TSC',
39+
});
40+
41+
42+
export default navbarItems;

‎docs/plugins.js‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
3+
4+
const plugins = [
5+
[
6+
'@docusaurus/plugin-content-docs',
7+
{
8+
id: 'tsc',
9+
path: 'external/tsc/faq',
10+
routeBasePath: 'tsc',
11+
sidebarPath: require.resolve('./sidebars-tsc.js'),
12+
editUrl: ({docPath}) =>
13+
`https://github.com/fairpm/tsc/blob/main/faqs/${docPath}`,
14+
},
15+
],
16+
];
17+
18+
19+
export default plugins;

‎docs/sidebars-tsc.js‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// @ts-check
2+
3+
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
4+
5+
/**
6+
* Creating a sidebar enables you to:
7+
- create an ordered group of docs
8+
- render a sidebar for each doc of that group
9+
- provide next/previous navigation
10+
11+
The sidebars can be generated from the filesystem, or explicitly defined here.
12+
13+
Create as many sidebars as you want.
14+
15+
@type {import('@docusaurus/plugin-content-docs').SidebarsConfig}
16+
*/
17+
const sidebarsTsc = {
18+
// By default, Docusaurus generates a sidebar from the docs folder structure
19+
tscSidebar: [{type: 'autogenerated', dirName: '.'}],
20+
21+
// But you can create a sidebar manually
22+
23+
// tscSidebar: [
24+
// 'intro',
25+
// 'hello',
26+
// {
27+
// type: 'category',
28+
// label: 'Tutorial',
29+
// items: ['tutorial-basics/create-a-document'],
30+
// },
31+
// ],
32+
};
33+
34+
export default sidebarsTsc;

0 commit comments

Comments
 (0)