You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, .vue and component with .js.ts could all be pages, so we can make vuepress support them out of box, while remaining the default pagesPattern to be only markdown.
The lang="yaml" is the default behavior, so we can make it optional, but declaring it provides volar with correct highlighting and formatting, we can also support lang='json'
For js and ts component, a frontmatter named export is preferred:
The page creation is based on markdown, and we extract page data by the markdown parser. If we want to support vue / ts pages, we need to parse the vue file / ts file when creating the page to keep the current process.
That means:
Extra overhead. The same script would be parse by createPage and bundler twice.
Some fields like data.headers would be unavailable for sure.
It might be ok if we skip the normal page creation process for vue / ts pages. However, I think this feature makes little sense for common users. Only some advance users might need this. IMO, no exceptions should be made for these rare cases.
In addition, for advanced users, they could already add pages via vue / ts by adding a custom Layout & node API.
Thus, I'm not in favor of adding extra complexity to this kind of feature that already has a way of being implemented.
If it's really a common use case, we can consider providing some method / utils to help adding pages programmatically
Clear and concise description of the problem
Generally,
.vue
and component with.js
.ts
could all be pages, so we can make vuepress support them out of box, while remaining the default pagesPattern to be only markdown.Suggested solution
A vue component:
The
lang="yaml"
is the default behavior, so we can make it optional, but declaring it provides volar with correct highlighting and formatting, we can also support lang='json'For js and ts component, a
frontmatter
named export is preferred:The text was updated successfully, but these errors were encountered: