Skip to content

Commit 4e972b5

Browse files
committed
Add versioned docs for v0.3.9 and update config
Introduced documentation versioning by adding versioned docs for v0.3.9 and updating Docusaurus config to support multiple versions. Added a version dropdown to the navbar and created versions.json to track available versions.
1 parent a7349c5 commit 4e972b5

File tree

3 files changed

+116
-51
lines changed

3 files changed

+116
-51
lines changed

docusaurus.config.ts

Lines changed: 68 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,146 @@
1-
import {themes as prismThemes} from 'prism-react-renderer';
2-
import type {Config} from '@docusaurus/types';
3-
import type * as Preset from '@docusaurus/preset-classic';
1+
import { themes as prismThemes } from "prism-react-renderer";
2+
import type { Config } from "@docusaurus/types";
3+
import type * as Preset from "@docusaurus/preset-classic";
44

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

77
const config: Config = {
8-
title: 'Viglet Documentation',
9-
tagline: 'Documentation about Viglet Products.',
10-
favicon: 'img/favicon.ico',
8+
title: "Viglet Documentation",
9+
tagline: "Documentation about Viglet Products.",
10+
favicon: "img/favicon.ico",
1111

1212
// Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
1313
future: {
1414
v4: true, // Improve compatibility with the upcoming Docusaurus v4
1515
},
1616

1717
// Set the production url of your site here
18-
url: 'https://docs-react.viglet.com',
18+
url: "https://docs-react.viglet.com",
1919
// Set the /<baseUrl>/ pathname under which your site is served
2020
// For GitHub pages deployment, it is often '/<projectName>/'
21-
baseUrl: '/',
22-
21+
baseUrl: "/",
22+
2323
trailingSlash: false,
2424
// GitHub pages deployment config.
2525
// If you aren't using GitHub pages, you don't need these.
26-
organizationName: 'openviglet', // Usually your GitHub org/user name.
27-
projectName: 'docs-react', // Usually your repo name.
26+
organizationName: "openviglet", // Usually your GitHub org/user name.
27+
projectName: "docs-react", // Usually your repo name.
2828

29-
onBrokenLinks: 'warn',
30-
onBrokenMarkdownLinks: 'warn',
29+
onBrokenLinks: "warn",
30+
31+
markdown: {
32+
hooks: {
33+
onBrokenMarkdownLinks: "warn",
34+
},
35+
},
3136

3237
// Even if you don't use internationalization, you can use this field to set
3338
// useful metadata like html lang. For example, if your site is Chinese, you
3439
// may want to replace "en" with "zh-Hans".
3540
i18n: {
36-
defaultLocale: 'en',
37-
locales: ['en'],
41+
defaultLocale: "en",
42+
locales: ["en"],
3843
},
3944

4045
presets: [
4146
[
42-
'classic',
47+
"classic",
4348
{
4449
docs: {
45-
sidebarPath: './sidebars.ts',
46-
editUrl:
47-
'https://github.com/openviglet/docs-react/tree/main/',
50+
sidebarPath: "./sidebars.ts",
51+
editUrl: "https://github.com/openviglet/docs-react/tree/main/",
52+
versions: {
53+
current: {
54+
label: "Stable (v2025.3)",
55+
},
56+
v0_3_9: {
57+
label: "Legacy (v0.3.9)",
58+
},
59+
},
60+
lastVersion: "current",
4861
},
4962
blog: {
5063
showReadingTime: true,
5164
feedOptions: {
52-
type: ['rss', 'atom'],
65+
type: ["rss", "atom"],
5366
xslt: true,
5467
},
55-
editUrl:
56-
'https://github.com/openviglet/docs-react/tree/main/',
68+
editUrl: "https://github.com/openviglet/docs-react/tree/main/",
5769
// Useful options to enforce blogging best practices
58-
onInlineTags: 'warn',
59-
onInlineAuthors: 'warn',
60-
onUntruncatedBlogPosts: 'warn',
70+
onInlineTags: "warn",
71+
onInlineAuthors: "warn",
72+
onUntruncatedBlogPosts: "warn",
6173
},
6274
theme: {
63-
customCss: './src/css/custom.css',
75+
customCss: "./src/css/custom.css",
6476
},
6577
} satisfies Preset.Options,
6678
],
6779
],
6880

6981
themeConfig: {
7082
// Replace with your project's social card
71-
image: 'img/viglet_logo_header.png',
83+
image: "img/viglet_logo_header.png",
7284
colorMode: {
7385
respectPrefersColorScheme: true,
7486
},
7587
navbar: {
76-
title: 'Docs',
88+
title: "Docs",
7789
logo: {
78-
alt: 'Viglet Docs Logo',
79-
src: 'img/viglet_logo_header.png',
90+
alt: "Viglet Docs Logo",
91+
src: "img/viglet_logo_header.png",
8092
},
8193
items: [
8294
{
83-
type: 'docSidebar',
84-
sidebarId: 'tutorialSidebar',
85-
position: 'left',
86-
label: 'Tutorial',
95+
type: "docSidebar",
96+
sidebarId: "tutorialSidebar",
97+
position: "left",
98+
label: "Tutorial",
8799
},
88-
{to: '/blog', label: 'Blog', position: 'left'},
89100
{
90-
href: 'https://github.com/openviglet',
91-
label: 'GitHub',
92-
position: 'right',
101+
type: "docsVersionDropdown",
102+
position: "right",
103+
dropdownActiveClassDisabled: true,
104+
},
105+
{ to: "/blog", label: "Blog", position: "left" },
106+
{
107+
href: "https://github.com/openviglet",
108+
label: "GitHub",
109+
position: "right",
93110
},
94111
],
95112
},
96113
footer: {
97-
style: 'dark',
114+
style: "dark",
98115
links: [
99116
{
100-
title: 'Docs',
117+
title: "Docs",
101118
items: [
102119
{
103-
label: 'Tutorial',
104-
to: '/docs/intro',
120+
label: "Tutorial",
121+
to: "/docs/intro",
105122
},
106123
],
107124
},
108125
{
109-
title: 'Community',
126+
title: "Community",
110127
items: [
111128
{
112-
label: 'Stack Overflow',
113-
href: 'https://stackoverflow.com/questions/tagged/viglet',
114-
}
129+
label: "Stack Overflow",
130+
href: "https://stackoverflow.com/questions/tagged/viglet",
131+
},
115132
],
116133
},
117134
{
118-
title: 'More',
135+
title: "More",
119136
items: [
120137
{
121-
label: 'Blog',
122-
to: '/blog',
138+
label: "Blog",
139+
to: "/blog",
123140
},
124141
{
125-
label: 'GitHub',
126-
href: 'https://github.com/openviglet',
142+
label: "GitHub",
143+
href: "https://github.com/openviglet",
127144
},
128145
],
129146
},
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Tutorial Intro 0.3.9
6+
7+
Let's discover **Docusaurus in less than 5 minutes**.
8+
9+
## Getting Started
10+
11+
Get started by **creating a new site**.
12+
13+
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
14+
15+
### What you'll need
16+
17+
- [Node.js](https://nodejs.org/en/download/) version 20.0 or above:
18+
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
19+
20+
## Generate a new site
21+
22+
Generate a new Docusaurus site using the **classic template**.
23+
24+
The classic template will automatically be added to your project after you run the command:
25+
26+
```bash
27+
npm init docusaurus@latest my-website classic
28+
```
29+
30+
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
31+
32+
The command also installs all necessary dependencies you need to run Docusaurus.
33+
34+
## Start your site
35+
36+
Run the development server:
37+
38+
```bash
39+
cd my-website
40+
npm run start
41+
```
42+
43+
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
44+
45+
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
46+
47+
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.

versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["v0_3_9"]

0 commit comments

Comments
 (0)