style: organize code styles

pull/129/head
Kia King Ishii 4 years ago
parent 6aa13ce9e8
commit a0261f758d

@ -1,13 +1,13 @@
// exports in this file are exposed to themes and md files via 'vitepress'
// so the user can do `import { useRoute, useSiteData } from 'vitepress'`
// so the user can do `import { useRoute, useSiteData } from 'vitepress'`.
// theme types
export * from './theme'
// composables
export { useRouter, useRoute, Router, Route } from './router'
export { useSiteData } from './composables/siteData'
export { useSiteDataByRoute } from './composables/siteDataByRoute'
export { useRouter, useRoute, Router, Route } from './router'
// components
export { Content } from './components/Content'

@ -1,12 +1,12 @@
import { createApp as createClientApp, createSSRApp } from 'vue'
import { inBrowser, pathToFile } from './utils'
import { createRouter, RouterSymbol } from './router'
import { siteDataRef } from './composables/siteData'
import { useSiteDataByRoute } from './composables/siteDataByRoute'
import { useUpdateHead } from './composables/head'
import { Content } from './components/Content'
import Debug from './components/Debug.vue'
import Theme from '/@theme/index'
import { inBrowser, pathToFile } from './utils'
import { useSiteDataByRoute } from './composables/siteDataByRoute'
import { siteDataRef } from './composables/siteData'
const NotFound = Theme.NotFound || (() => '404 Not Found')
@ -23,7 +23,7 @@ export function createApp() {
// use lean build if this is the initial page load or navigating back
// to the initial loaded path (the static vnodes already adopted the
// static content on that load so no need to re-fetch the page)
// static content on that load so no need to re-fetch the page).
if (isInitialPageLoad || initialPath === pageFilePath) {
pageFilePath = pageFilePath.replace(/\.js$/, '.lean.js')
}

@ -8,41 +8,46 @@ export namespace DefaultTheme {
/**
* GitHub repository following the format <user>/<project>.
*
* @example vuejs/vue-next
* @example `"vuejs/vue-next"`
*/
repo?: string
/**
* Customize the header label. Defaults to GitHub/Gitlab/Bitbucket depending
* on the provided repo
* Customize the header label. Defaults to GitHub/Gitlab/Bitbucket
* depending on the provided repo.
*
* @exampe `"Contribute!"`
*/
repoLabel?: string
/**
* If your docs are in a different repository from your main project
* If your docs are in a different repository from your main project.
*
* @example `"vuejs/docs-next"`
*/
docsRepo?: string
/**
* If your docs are not at the root of the repo.
*
* @example `"docs"`
*/
docsDir?: string
/**
* If your docs are in a different branch. Defaults to `master`
* If your docs are in a different branch. Defaults to `master`.
*
* @example `"next"`
*/
docsBranch?: string
/**
* Enable links to edit pages at the bottom of the page
* Enable links to edit pages at the bottom of the page.
*/
editLinks?: boolean
/**
* Custom text for edit link. Defaults to "Edit this page"
* Custom text for edit link. Defaults to "Edit this page".
*/
editLinkText?: string
@ -88,10 +93,12 @@ export namespace DefaultTheme {
export interface SideBarGroup {
text: string
link?: string
/**
* @default false
*/
collapsable?: boolean
children: SideBarItem[]
}
@ -102,10 +109,12 @@ export namespace DefaultTheme {
* @default 5
*/
maxSuggestions?: number
/**
* @default ''
*/
placeholder?: string
algolia?: {
apiKey: string
indexName: string

@ -3,7 +3,7 @@ import './styles/layout.css'
import './styles/code.css'
import './styles/custom-blocks.css'
import { Theme } from '/@app/theme'
import { Theme } from 'vitepress'
import Layout from './Layout.vue'
import NotFound from './NotFound.vue'

Loading…
Cancel
Save