base path refactor to better support subpath hosting

This commit is contained in:
Jacky Zhao
2023-08-19 15:52:25 -07:00
parent 3201f83b70
commit c874e7e937
29 changed files with 257 additions and 389 deletions

View File

@ -1,10 +1,9 @@
import { canonicalizeServer, pathToRoot } from "../util/path"
import { pathToRoot } from "../util/path"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
function PageTitle({ fileData, cfg }: QuartzComponentProps) {
const title = cfg?.pageTitle ?? "Untitled Quartz"
const slug = canonicalizeServer(fileData.slug!)
const baseDir = pathToRoot(slug)
const baseDir = pathToRoot(fileData.slug!)
return (
<h1 class="page-title">
<a href={baseDir}>{title}</a>