Skip to content

Commit d7b02c7

Browse files
committed
feat(docs): improve documentation build process and static file handling
- Updated the `docs:build` script in package.json to copy specific text files to the build output directory for better asset management. - Enhanced VitePress configuration to serve static files from the public directory and set up URL rewrites for easier access to llms files. - This change optimizes the documentation build process and improves the accessibility of static assets.
1 parent bbb422d commit d7b02c7

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

docs/.vitepress/config.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolve } from 'path'
12
import { defineConfig } from 'vitepress'
23

34
// Función para obtener la última versión de npm
@@ -21,6 +22,20 @@ export default async () => {
2122
title: "Tokenly",
2223
description: "Advanced JWT Token Management",
2324

25+
// Configuración para servir archivos estáticos
26+
vite: {
27+
resolve: {
28+
alias: {
29+
'@llms': resolve(__dirname, '../public')
30+
}
31+
}
32+
},
33+
34+
rewrites: {
35+
'/llms.txt': '/public/llms.txt',
36+
'/llms-full.txt': '/public/llms-full.txt'
37+
},
38+
2439
head: [
2540
['link', { rel: 'icon', type: 'image/svg+xml', href: '/tokenly/logo-light.svg', media: '(prefers-color-scheme: light)' }],
2641
['link', { rel: 'icon', type: 'image/svg+xml', href: '/tokenly/logo-dark.svg', media: '(prefers-color-scheme: dark)' }],
@@ -256,14 +271,5 @@ export default async () => {
256271
sh: "bash",
257272
}
258273
},
259-
260-
vite: {
261-
publicDir: 'public',
262-
},
263-
264-
rewrites: {
265-
'llms.txt': '/llms.txt',
266-
'llms-full.txt': '/llms-full.txt'
267-
}
268274
})
269275
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"commit": "git-cz",
5050
"semantic-release": "semantic-release --branches main",
5151
"docs:dev": "vitepress dev docs",
52-
"docs:build": "vitepress build docs",
52+
"docs:build": "vitepress build docs && cp docs/public/llms*.txt docs/.vitepress/dist/",
5353
"docs:preview": "vitepress preview docs",
5454
"docs:deploy": "BASE=/tokenly/ npm run docs:build && gh-pages -d docs/.vitepress/dist"
5555
},
@@ -98,4 +98,4 @@
9898
"publishConfig": {
9999
"access": "public"
100100
}
101-
}
101+
}

0 commit comments

Comments
 (0)