fix: config base by vite.config.ts not cli, close #54

This commit is contained in:
YunYouJun 2022-07-15 00:04:41 +08:00
parent 338c7ddc08
commit 3e4030433a
5 changed files with 4 additions and 13 deletions

View File

@ -4,7 +4,7 @@ title: Valaxy
titleTemplate: Next Generation Static Blog Framework
hero:
name: Valaxy
name: VALAXY
text: Next Generation Static Blog Framework
tagline: Simple, powerful, and performant. Meet the modern BLOG framework you've always wanted.
actions:

View File

@ -8,7 +8,7 @@ const fm = useFrontmatter()
<template>
<h1 m="t-10" text="center">
<span text="8xl" font="black" class="gradient-text from-purple-800 to-blue-500" bg="gradient-to-r">
{{ fm.title }}
{{ fm.hero.name }}
</span>
<br>
<small opacity="75">LOGO NOT READY</small>

View File

@ -128,14 +128,10 @@ cli.command(
type: 'string',
default: 'dist',
describe: 'output dir',
}).option('base', {
type: 'string',
default: '/',
describe: 'output base',
})
.strict()
.help(),
async ({ ssg, root, base, output }) => {
async ({ ssg, root, output }) => {
const options = await resolveOptions({ userRoot: root }, 'build')
printInfo(options)
@ -144,7 +140,6 @@ cli.command(
{
// avoid load userRoot/vite.config.ts repeatedly
configFile: path.resolve(options.clientRoot, 'vite.config.ts'),
base,
build: {
// make out dir empty, https://vitejs.dev/config/#build-emptyoutdir
emptyOutDir: true,

View File

@ -113,10 +113,7 @@ export async function setupMarkdownPlugins(md: MarkdownIt, mdOptions: MarkdownOp
}
export const createMarkdownRenderer = async (
srcDir: string,
mdOptions: MarkdownOptions = {},
// eslint-disable-next-line @typescript-eslint/no-unused-vars
base = '/',
): Promise<MarkdownRenderer> => {
const md = MarkdownIt({
html: true,

View File

@ -63,10 +63,9 @@ export async function createMarkdownToVueRenderFn(
pages: string[],
userDefines: Record<string, any> | undefined,
isBuild = false,
base = '/',
includeLastUpdatedData = false,
) {
const md = await createMarkdownRenderer(srcDir, options, base)
const md = await createMarkdownRenderer(options)
pages = pages.map(p => slash(p.replace(/\.md$/, '')))