Skip to content

Commit c38d932

Browse files
committed
🧱 Move db/ pages to ortfo/db/docs
1 parent 93739a3 commit c38d932

39 files changed

+22
-2442
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,4 @@ public/*.schema.json
165165
public/v*/*.schema.json
166166
public/latest/*.schema.json
167167
schemas/
168+
db/

.vitepress/config.mts

+18-13
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { DefaultTheme, defineConfig, HeadConfig } from "vitepress"
22
import footnote from "markdown-it-footnote"
33
import deflists from "markdown-it-deflist"
44
import { faviconHead } from "./favicon"
5-
import subcommand from "../db/commands/[subcommand].paths"
65
import { seoTags } from "./seo"
6+
import { readdirSync } from "node:fs"
77

88
const ortfodbSidebar = [
99
{
@@ -140,16 +140,15 @@ const ortfodbSidebar = [
140140
collapsed: true,
141141
items: [
142142
{ text: "Global options", link: "/db/commands/global-options" },
143-
...subcommand
144-
.paths()
145-
.filter(
146-
({ params: { subcommand } }) =>
147-
!["README", "global-options"].includes(subcommand)
148-
)
149-
.map(({ params: { subcommand } }) => ({
150-
text: subcommand.replace("-", " "),
151-
link: `/db/commands/${subcommand}`,
152-
})),
143+
...readdirSync("db/commands")
144+
.map((file) => {
145+
const name = file.replace(/\.md$/, "")
146+
return {
147+
text: `ortfodb ${name.replace(/-/g, " ")}`,
148+
link: `/db/commands/${name}`,
149+
}
150+
})
151+
.filter(({ link }) => link !== "/db/commands/global-options"),
153152
],
154153
},
155154

@@ -188,7 +187,7 @@ export default defineConfig({
188187
lang: "en-US",
189188
title: "ortfo",
190189
description: "Make & manage your own homemade portfolio easily",
191-
srcExclude: ["**/README.md", "ortfodb/**/*.md"],
190+
srcExclude: ["**/README.md", "ortfodb/**/*.md", "ortfodb/docs/"],
192191
head: [
193192
[
194193
"link",
@@ -232,7 +231,13 @@ export default defineConfig({
232231
},
233232
},
234233
editLink: {
235-
pattern: "https://github.com/ortfo/website/edit/main/:path",
234+
pattern: ({ filePath }) =>
235+
filePath.startsWith("db/")
236+
? `https://github.com/ortfo/db/edit/main/docs/${filePath.replace(
237+
/^db\//,
238+
""
239+
)}`
240+
: `https://github.com/ortfo/website/edit/main/${filePath}`,
236241
},
237242
logo: {
238243
dark: "/logo-dark.svg",

db/building.md

-106
This file was deleted.

db/caching.md

Whitespace-only changes.

db/changelog.data.js

-5
This file was deleted.

db/changelog.md

-11
This file was deleted.

db/client-libraries-versions.js

-70
This file was deleted.

db/client-libraries.data.js

-18
This file was deleted.

0 commit comments

Comments
 (0)