Skip to content

Commit cc75a91

Browse files
committed
config reformat and restructuring to support i18n later on
1 parent 352758f commit cc75a91

28 files changed

+188
-746
lines changed

src/webpage/.vitepress/config.mts

-51
This file was deleted.

src/webpage/.vitepress/config/en.ts

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import {DefaultTheme, defineConfig} from "vitepress";
2+
3+
4+
export const en = defineConfig({
5+
lang: 'en-US',
6+
description: "an out-of-the-box Dynamic API for many databases",
7+
8+
themeConfig: {
9+
nav: nav(),
10+
sidebar: {
11+
'/guide/': { base: '/guide/', items: sidebarGuide() },
12+
'/references/': { base: '/references/', items: sidebarReferences() },
13+
},
14+
}
15+
})
16+
17+
18+
function nav(): DefaultTheme.NavItem[] {
19+
return [
20+
{
21+
text: "Guide",
22+
link: '/guide/what-is-dynapi/',
23+
activeMatch: '/guide/',
24+
},
25+
{
26+
text: "References",
27+
link: '/references/',
28+
activeMatch: '/references/',
29+
},
30+
{
31+
text: "Repositories",
32+
items: [
33+
{
34+
text: "DynAPI",
35+
link: 'https://github.com/DynAPI/org.dynapi.DynAPI',
36+
target: '_blank',
37+
},
38+
{
39+
text: "DynAPI (v1)",
40+
link: 'https://github.com/DynAPI/DynAPI-v1',
41+
target: '_blank',
42+
},
43+
{
44+
text: "DynAPI Website",
45+
link: 'https://github.com/DynAPI/DynAPI.github.io',
46+
target: '_blank',
47+
},
48+
{
49+
text: "The Interceptor",
50+
link: 'https://github.com/DynAPI/Interceptor',
51+
target: '_blank',
52+
},
53+
{
54+
text: "org.dynapi:squirtle",
55+
link: 'https://github.com/DynAPI/org.dynapi.squirtle',
56+
target: '_blank',
57+
},
58+
{
59+
text: "org.dynapi:openapispec",
60+
link: 'https://github.com/DynAPI/org.dynapi.openapispec',
61+
target: '_blank',
62+
},
63+
{
64+
text: "org.dynapi:json-schema-gen",
65+
link: 'https://github.com/DynAPI/org.dynapi.json-schema-gen',
66+
target: '_blank',
67+
},
68+
]
69+
},
70+
]
71+
}
72+
73+
function sidebarGuide(): DefaultTheme.SidebarItem[] {
74+
return [
75+
{
76+
text: "Introduction",
77+
items: [
78+
{
79+
text: "What is DynAPI?",
80+
link: "/guide/what-is-dynapi/",
81+
},
82+
{
83+
text: "Getting Started",
84+
link: "/guide/quickstart/",
85+
},
86+
{
87+
text: "Proxy Server",
88+
link: "/guide/proxy-server/",
89+
collapsed: true,
90+
items: [
91+
{
92+
text: "NGINX",
93+
link: "/guide/proxy-server/nginx/",
94+
},
95+
{
96+
text: "Apache",
97+
link: "/guide/proxy-server/apache/",
98+
}
99+
]
100+
},
101+
]
102+
},
103+
{
104+
text: "Configuration",
105+
link: "/references/config/"
106+
}
107+
]
108+
}
109+
110+
function sidebarReferences(): DefaultTheme.SidebarItem[] {
111+
return [
112+
{
113+
text: "Reference",
114+
link: "/references/",
115+
items: [
116+
{
117+
text: "Configuration",
118+
link: "/references/config/"
119+
}
120+
]
121+
}
122+
]
123+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from "vitepress";
2+
import { shared } from "./shared";
3+
import { en } from "./en";
4+
5+
6+
export default defineConfig({
7+
...shared,
8+
locales: {
9+
root: { label: "English", ...en },
10+
}
11+
})
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import {defineConfig} from "vitepress";
2+
3+
4+
export const shared = defineConfig({
5+
title: "DynAPI",
6+
7+
rewrites: {
8+
'en/:rest*': ':rest*'
9+
},
10+
11+
lastUpdated: true,
12+
cleanUrls: true,
13+
metaChunk: true,
14+
15+
head: [
16+
['link', { rel: 'icon', type: 'image/svg+xml', href: '/dynapi.svg' }],
17+
['meta', { name: 'theme-color', content: '#6196ff' }],
18+
['meta', { property: 'og:type', content: 'website' }],
19+
['meta', { property: 'og:locale', content: 'en' }],
20+
['meta', { property: 'og:title', content: 'DynAPI | an out-of-the-box Dynamic API for many databases' }],
21+
['meta', { property: 'og:site_name', content: 'DynAPI' }],
22+
['meta', { property: 'og:image', content: 'https://dynapi.github.io/og-image.png' }],
23+
['meta', { property: 'og:image:type', content: 'image/png' }],
24+
['meta', { property: 'og:url', content: 'https://dynapi.github.io/' }],
25+
],
26+
27+
themeConfig: {
28+
logo: {
29+
src: '/dynapi.svg',
30+
width: 24,
31+
height: 24,
32+
},
33+
socialLinks: [
34+
{ icon: 'github', link: 'https://github.com/DynAPI/org.dynapi.dynapi' },
35+
],
36+
search: {
37+
provider: 'local',
38+
},
39+
footer: {
40+
copyright: "Copyright © 2024-present DynAPI",
41+
}
42+
},
43+
44+
ignoreDeadLinks: 'localhostLinks',
45+
markdown: {
46+
image: {
47+
lazyLoading: true,
48+
}
49+
}
50+
})

src/webpage/.vitepress/nav.mts

-54
This file was deleted.

src/webpage/.vitepress/sidebar.mts

-54
This file was deleted.

src/webpage/src/index.md renamed to src/webpage/en/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ features:
4141
<script setup>
4242
import { withBase } from "vitepress";
4343
import { VPTeamMembers } from 'vitepress/theme';
44-
import { data as databases } from "/data/databases.data.ts";
45-
import { data as members } from "/data/members.data.ts";
44+
import { data as databases } from "/home/playerg9/git/playerg9/orgs/DynAPI/DynAPI.github.io/src/webpage/data/databases.data.ts";
45+
import { data as members } from "/home/playerg9/git/playerg9/orgs/DynAPI/DynAPI.github.io/src/webpage/data/members.data.ts";
4646
</script>
4747

4848
<style>

0 commit comments

Comments
 (0)