mirror of
https://github.com/alrayyes/wiki.git
synced 2025-06-08 14:43:39 +00:00
fix: 404 page styling for nested pages (closes #458)
This commit is contained in:
parent
71d81bde1d
commit
60a3c54339
7 changed files with 31 additions and 13 deletions
quartz/components
|
@ -3,7 +3,7 @@ import { QuartzComponent, QuartzComponentProps } from "./types"
|
|||
import HeaderConstructor from "./Header"
|
||||
import BodyConstructor from "./Body"
|
||||
import { JSResourceToScriptElement, StaticResources } from "../util/resources"
|
||||
import { FullSlug, joinSegments, pathToRoot } from "../util/path"
|
||||
import { FullSlug, RelativeURL, joinSegments } from "../util/path"
|
||||
|
||||
interface RenderComponents {
|
||||
head: QuartzComponent
|
||||
|
@ -15,9 +15,10 @@ interface RenderComponents {
|
|||
footer: QuartzComponent
|
||||
}
|
||||
|
||||
export function pageResources(slug: FullSlug, staticResources: StaticResources): StaticResources {
|
||||
const baseDir = pathToRoot(slug)
|
||||
|
||||
export function pageResources(
|
||||
baseDir: FullSlug | RelativeURL,
|
||||
staticResources: StaticResources,
|
||||
): StaticResources {
|
||||
const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json")
|
||||
const contentIndexScript = `const fetchData = fetch(\`${contentIndexPath}\`).then(data => data.json())`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue