feat(aklive2d): add an index page

This commit is contained in:
Haoyu Xu
2023-01-02 03:11:25 -05:00
parent 518f8c8064
commit 0fb857c879
19 changed files with 810 additions and 12939 deletions

27
template/index/config.js Normal file
View File

@@ -0,0 +1,27 @@
import path from 'path'
import { parse } from 'yaml'
import fs from 'fs'
function read_yaml(file_dir) {
const include = {
identify: value => value.startsWith('!include'),
tag: '!include',
resolve(str) {
const dir = path.resolve(BASEDIR, str)
const data = read_yaml(dir)
return data
}
}
const file = fs.readFileSync(file_dir, 'utf8')
return parse(file, {
customTags: [include],
})
}
const BASEDIR = path.resolve(__dirname, '..', '..')
const CONFIG = read_yaml(path.join(BASEDIR, 'config.yaml'))
export default {
basedir: BASEDIR,
...CONFIG
}