Update Site to Vitepress 1.0.0-rc.4 and fix gh-icon api (#1491)

* update site dependencies

* revert preact change

* update config
This commit is contained in:
Eric Fennis
2023-08-09 17:09:21 +02:00
committed by GitHub
parent b684a0083b
commit 8cff59627b
3 changed files with 394 additions and 99 deletions
+3 -36
View File
@@ -1,14 +1,6 @@
import { fileURLToPath, URL } from 'node:url'
import path from 'path';
import { defineConfig } from 'vitepress'
import { createWriteStream } from 'node:fs'
import { resolve } from 'node:path'
import { SitemapStream } from 'sitemap'
import sidebar from './sidebar';
import fs from 'fs';
const links = []
const title = "Lucide";
const socialTitle = "Lucide Icons";
@@ -126,32 +118,7 @@ export default defineConfig({
pattern: 'https://github.com/lucide-icons/lucide/edit/main/docs/:path'
},
},
transformHtml: (_, id, { pageData }) => {
if (/[\\/]404\.html$/.test(id)) {
return
}
if (pageData.relativePath.startsWith('icons/')) {
links.push({
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
lastmod: pageData?.params?.changedRelease?.date
})
return
}
links.push({
url: pageData.relativePath.replace(/((^|\/)index)?\.md$/, '$2'),
lastmod: pageData.lastUpdated
})
},
buildEnd: async ({ outDir }) => {
const sitemap = new SitemapStream({
hostname: 'https://lucide.dev/'
})
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'))
sitemap.pipe(writeStream)
links.forEach((link) => sitemap.write(link))
sitemap.end()
await new Promise((r) => writeStream.on('finish', r))
},
sitemap: {
hostname: 'https://lucide.dev/'
}
})
+6 -6
View File
@@ -2,10 +2,10 @@
"name": "@lucide/docs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"docs:dev": "pnpm run \"/^prebuild:.*/\" && vitepress dev",
"docs:dev": "pnpm prebuild && vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview",
"build:docs": "vitepress build",
@@ -18,16 +18,16 @@
"dev": "npx nitropack dev",
"build:api": "npx nitropack build",
"prebuild": "pnpm prebuild:iconNodes && pnpm prebuild:metaJson && pnpm prebuild:releaseJson && pnpm prebuild:relatedIcons && pnpm prebuild:iconDetails",
"build": "pnpm run \"/^prebuild:.*/\" && pnpm build:api && pnpm build:docs && pnpm postbuild:vercelJson",
"build": "pnpm prebuild && pnpm build:api && pnpm build:docs && pnpm postbuild:vercelJson",
"preview": "node .output/server/index.mjs"
},
"author": "Eric Fennis",
"license": "ISC",
"devDependencies": {
"h3": "^1.6.4",
"nitropack": "^2.4.1",
"h3": "^1.7.1",
"nitropack": "2.4.1",
"node-fetch": "2",
"vitepress": "1.0.0-beta.1"
"vitepress": "1.0.0-rc.4"
},
"dependencies": {
"@floating-ui/vue": "^1.0.1",