Skip to content

Commit

Permalink
website: Add profile template api
Browse files Browse the repository at this point in the history
  • Loading branch information
tiann committed Oct 21, 2023
1 parent 906007a commit 6cce322
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions website/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@


import { createRequire } from 'module'
import { defineConfig } from 'vitepress'
import { defineConfig, SiteConfig } from 'vitepress'
import locales from './locales'

const require = createRequire(import.meta.url)
const pkg = require('vitepress/package.json')
import { readdir, writeFile } from 'fs/promises'
import { resolve } from 'path'

export default defineConfig( {
title: 'KernelSU',
locales: locales.locales
locales: locales.locales,
buildEnd: async (config: SiteConfig) => {
const templateDir = resolve(config.outDir, 'templates')
const files = await readdir(templateDir);
const templateList = resolve(templateDir, "index.json")
await writeFile(templateList, JSON.stringify(files))
}
})

0 comments on commit 6cce322

Please sign in to comment.