Basics
You should remove this page when making your docs.
Speedrun-Docs is template of Docusaurus. Anything you want to customise or need help with can be found from their documentation.
Installation
- Install NodeJS LTS
- Open a terminal and navigate to a folder to install the docs
- Run these commands
npx create-docusaurus@latest my-game-speedrun-docs https://github.com/EwanLyon/speedrun-docs
cd my-game-speedrun-docs
npx docusaurus start
speedrun-docs.json
A basic JSON file to fill in basic information about the speedrun game and the github repository. Saves you some time in the docusaurus.config.ts.
The file can be found in the root directory of the project.
{
"game": "Example Game",
"speedrun.com": "https://www.speedrun.com/example_game",
"discord": "discord.gg/example_game",
"github": {
"username": "ExampleUser",
"projectName": "example-game-speedrun-docs"
}
}
Creating pages
To create pages make a new text file with the file extension .md
in the docs/
folder.
To create nested pages create a folder and add the file there.
Front matter
Docusaurus has support for more information at the top of a markdown file called "front matter".
---
sidebar_position: 1
description: This is a handmade description for a page
sidebar_custom_props:
image: <url>
---
Speedrun-Docs Custom Props
Speedrun Docs will have support for more built in theming.
Property | Type |
---|---|
image | String |
image
Adding a sidebar_custom_props
to the front matter and then adding an image
property under that (like in the example above), will add an image to the generated sidebar document view.
An example of this can be seen in the Any% generated page and in the front matter for Level 1.
Adding new tabs
Adding a new tab at the top such as the "Tutorial" and "Resources" tab.
- Create a new folder in
docs/
- Open
sidebars.ts
- Add
tabnameSidebar: [{ type: 'autogenerated', dirName: '<New Doc Directory>' }]
- E.g. A new tab for just 100% could look like:
hundredPercentSidebar: [{ type: 'autogenerated', dirName: '100' }]
- E.g. A new tab for just 100% could look like:
- Add
- Open
docusaurus.config.ts
-
Scroll to down to the
themeConfig
-
In
navbar
in theitems
square brackets adddocusaurus.config.ts{
type: 'docSidebar',
sidebarId: '<New Tab>Sidebar',
position: 'left',
label: '<New Tab Name>',
}-
E.g.
docusaurus.config.ts{
type: 'docSidebar',
sidebarId: 'hundredPercentSidebar',
position: 'left',
label: '100%',
}
-
-