Closed slusarz closed 2 months ago
Sure, thank you for the feedback. I will work on it in the next two days. In the meantime, you can revert back to the previous version and use 0.4.3.
Can you provide a demo? I'll try to reproduce it. Is this related to the VitePress version?
Our installation should be up-to-date, using VitePress 1.2.3: https://github.com/dovecot/documentation/blob/ced4a60d804d414dc2c1dec56e0745aab16fbbac/package.json
I don't think we're doing anything too crazy with the config either: https://github.com/dovecot/documentation/blob/ced4a60d804d414dc2c1dec56e0745aab16fbbac/.vitepress/config.js
Running npm run docs:build
command. Dump of the code
variable in the transform()
function gives:
export const __pageData = JSON.parse("{\"title\":\"Administration\",\"description\":\"\",\"frontmatter\":{\"title\":\"Administration\",\"exclude\":true,\"order\":110},\"headers\":[],\"relativePath\":\"core/admin/index.md\",\"filePath\":\"core/admin/index.md\",\"lastUpdated\":1719485127000}")
const _sfc_main = {name:"core/admin/index.md"}
import { openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue"
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return (_openBlock(), _createElementBlock("div"))
}
import _export_sfc from 'plugin-vue:export-helper'
export default /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render]])
Probably located the cause of the problem. This problem occurs when there is only frontMatter and no content in the document.
I'll make it compatible with this scene.
Ah, yes, that's probably a bit unique to our setup as we use an auto sidebar generator, where these empty MD files are used to insert/configure sidebar stuff without creating an actual page.
Thanks for tracking this down.
Does that mean that it's possible not to index those pages without content?
There's nothing to index, so I would have no problem with the pagefind plugin code just skipping that page.
you can try vitepress-plugin-pagefind@0.4.5
https://github.com/ATQQ/sugar-blog/commit/b47b21350ee0106df7241f255545f4ef92af98f8 introduced this code:
This code assumes the Vue rendering code is of the format
_createElementBlock("div", null, [ ... ])
.However, on out system, the rendering code is simply outputting a single, empty DIV tag. This uses the simplified function signature
_createElementBlock("div")
. Example:This results in every page issuing this warning:
And the second replace call fails.
Solution: Replace code needs to check for both function signatures.