Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
# Allow running this workflow manually from the Actions tab
workflow_dispatch:

defaults:
run:
shell: bash
Expand All @@ -24,6 +24,12 @@ jobs:
with:
fetch-depth: 0

- name: Checkout TSC faqs
uses: actions/checkout@v4
with:
repository: fairpm/tsc
path: docs/external/tsc/

- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

# Allow running this workflow manually from the Actions tab
workflow_dispatch:

defaults:
run:
shell: bash
Expand All @@ -23,10 +23,32 @@ jobs:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Docusaurus site
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout TSC faqs
uses: actions/checkout@v4
with:
repository: fairpm/tsc
path: docs/external/tsc/

- name: Debug checked out files
run: |
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE"
echo "Current directory:"
pwd
echo "Repo root:"
ls -la "$GITHUB_WORKSPACE"
echo "Docs root:"
ls -la "$GITHUB_WORKSPACE/docs"
echo "External:"
find "$GITHUB_WORKSPACE/docs/external" -maxdepth 5 -type d -print || true
echo "Expected folder:"
ls -la "$GITHUB_WORKSPACE/docs/external/tsc/faqs" || true
working-directory: .

- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
36 changes: 7 additions & 29 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// See: https://docusaurus.io/docs/api/docusaurus-config

import {themes as prismThemes} from 'prism-react-renderer';
import navbarItems from './navbarItems.js';
import plugins from './plugins.js';

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

Expand All @@ -30,7 +32,8 @@ const config = {
projectName: 'docs',
deploymentBranch: 'gh-pages',

onBrokenLinks: 'throw',
// onBrokenLinks: 'throw',
onBrokenLinks: 'log',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
Expand Down Expand Up @@ -80,34 +83,7 @@ const config = {
// alt: 'FAIR Logo',
// src: 'img/logo.svg',
// },
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
},
{
to: '/blog',
label: 'Blog',
position: 'left'
},
{
to: 'docs/contributing',
label: 'Get involved',
position: 'left'
},
{
href: 'https://github.com/fairpm/docs',
label: 'GitHub',
position: 'right',
},
{
href: 'https://fair.pm/',
label: 'fair.pm',
position: 'right',
},
],
items: navbarItems,
},
footer: {
style: 'dark',
Expand Down Expand Up @@ -167,6 +143,8 @@ const config = {
darkTheme: prismThemes.dracula,
},
}),

plugins: plugins,
};

export default config;
42 changes: 42 additions & 0 deletions docs/navbarItems.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check


const navbarItems = [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Docs',
},
{
to: '/blog',
label: 'Blog',
position: 'left'
},
{
to: 'docs/contributing',
label: 'Get involved',
position: 'left'
},
{
href: 'https://github.com/fairpm/docs',
label: 'GitHub',
position: 'right',
},
{
href: 'https://fair.pm/',
label: 'fair.pm',
position: 'right',
},
];

navbarItems.push({
type: 'docSidebar',
sidebarId: 'tscSidebar',
docsPluginId: 'tsc',
position: 'left',
label: 'TSC',
});


export default navbarItems;
19 changes: 19 additions & 0 deletions docs/plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// @ts-check


const plugins = [
[
'@docusaurus/plugin-content-docs',
{
id: 'tsc',
path: 'external/tsc/faqs',
routeBasePath: 'tsc',
sidebarPath: require.resolve('./sidebars-tsc.js'),
editUrl: ({docPath}) =>
`https://github.com/fairpm/tsc/blob/main/faqs/${docPath}`,
},
],
];


export default plugins;
34 changes: 34 additions & 0 deletions docs/sidebars-tsc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @ts-check

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

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation

The sidebars can be generated from the filesystem, or explicitly defined here.

Create as many sidebars as you want.

@type {import('@docusaurus/plugin-content-docs').SidebarsConfig}
*/
const sidebarsTsc = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tscSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually

// tscSidebar: [
// 'intro',
// 'hello',
// {
// type: 'category',
// label: 'Tutorial',
// items: ['tutorial-basics/create-a-document'],
// },
// ],
};

export default sidebarsTsc;
Loading