0.0.14 • Published 12 months ago
@zyjared/buildpage v0.0.14
buildpage
根据 markdown 文件生成个人单页 html。
使用
确保根目录存在 README.md
,使用以下命令得到 index.html
:
npx @zyjared/buildpage
如果需要特定的样式,src/themes
内的 README.md
为示例文件。
配置
如果不需要默认行为,也可以创建 buildpage.config.js
进行配置。
const { defineConfig } = require('@zyjared/buildpage')
module.exports = defineConfig({
input: 'README.md',
output: 'index.html',
assets: {
dir: '.',
outDir: '.',
clean: false,
overwrite: true,
include: [],
ignore: ['README.md'],
},
// https://unhead.unjs.io/usage/composables/use-head#input
head: {
link: [
// { rel: 'stylesheet', href: 'custom.css' },
],
meta: [
// { name: 'description', content: 'some description' },
// { name: 'keywords', content: 'keywords1, keywords2' },
]
},
})
如果
public
目录中存在style.css
文件,这将会自动添加到<head>
中。
其他
pnpm buildpage -h
# Usage: buildpage [options]
#
# Options:
# -V, --version output the version number
# -c, --config <config> Path to the configuration file
# -o, --output <output> Path to the output HTML file
# -i, --input <input> Path to the input Markdown file
# -a, --assets <assets> Path to the assets directory
# -d, --dist <dist> Output directory for the generated files
# -h, --help display help for command