fix(ssr): remove context
This commit is contained in:
parent
d53b8dadb3
commit
46261572e3
12 changed files with 58 additions and 59 deletions
|
|
@ -41,13 +41,12 @@ function saveData (maxAge) {
|
|||
export function genIndex (path, content = '', router) {
|
||||
const tokens = window.marked.lexer(content)
|
||||
const slugify = window.Docsify.slugify
|
||||
const toURL = router.toURL
|
||||
const index = {}
|
||||
let slug
|
||||
|
||||
tokens.forEach(token => {
|
||||
if (token.type === 'heading' && token.depth <= 2) {
|
||||
slug = toURL(path, { id: slugify(token.text) })
|
||||
slug = router.toURL(path, { id: slugify(token.text) })
|
||||
index[slug] = { slug, title: token.text, body: '' }
|
||||
} else {
|
||||
if (!slug) return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue