|
|
|
@ -20,13 +20,22 @@ export const RouterSymbol: InjectionKey<Router> = Symbol()
|
|
|
|
|
// matter and is only passed to support same-host hrefs.
|
|
|
|
|
const fakeHost = `http://a.com`
|
|
|
|
|
|
|
|
|
|
const getDefaultPageData = (): PageData => ({
|
|
|
|
|
relativePath: '',
|
|
|
|
|
title: '',
|
|
|
|
|
description: '',
|
|
|
|
|
headers: [],
|
|
|
|
|
frontmatter: {},
|
|
|
|
|
lastUpdated: 0
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const getDefaultRoute = (): Route => ({
|
|
|
|
|
path: '/',
|
|
|
|
|
component: null,
|
|
|
|
|
// this will be set upon initial page load, which is before
|
|
|
|
|
// the app is mounted, so it's guaranteed to be available in
|
|
|
|
|
// components
|
|
|
|
|
data: null as any
|
|
|
|
|
data: getDefaultPageData()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
interface PageModule {
|
|
|
|
|