-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blog-plugin: wrong rendering for the router '/tag/' and '/category/' #1073
Comments
/tag/
& /category/
I also encountered a similar problem. The part of adding the page of the plugin is working properly. I added debug print. build.js async function renderPage (page) {
const pagePath = page.path
readline.clearLine(process.stdout, 0)
readline.cursorTo(process.stdout, 0)
process.stdout.write(`Rendering page: ${pagePath}\n`)
console.log('path: ', page.path) // add
console.log('frontmatter: ', page.frontmatter) // add LayoutDistoributor.vue export default {
computed: {
layout () {
console.log('path: ', this.$page.path) // add
console.log('frontmatter: ', this.$page.frontmatter) // add
if (this.$page.path) {
return this.$page.frontmatter.layout || 'Layout'
}
return 'NotFound'
}
}
} I got the following output.
|
@tohutohu '/tag/' & '/category/' match the first condition of enhancers when |
@EliazTray The problem between you and me may be different. |
The new page of the blog plugin cannot be used because the getSiteData method has been executed before the plugin ready. |
Thanks to @Mrminfive , there has been a PR for this issue |
Bug report
Version
@vuepress 1.0.0-alpha.27
Steps to reproduce
Create
Layout.vue
,Page.vue
,Post.vue
,Tag.vue
,Tags.vue
,Category.vue
,Categories.vue
under the 'layouts' directory.npm run dev
visit
/tag/
.What is expected?
It will use
Cateogries.vue
layout to render.What is actually happening?
it used
Page.vue
layout to render.Other relevant information
v1.0.0.alpha.27
The text was updated successfully, but these errors were encountered: