Comments (22)
收到我看一下
from sugar-blog.
是单独使用 这个插件遇到的问题吗?
vitepress-plugin-pagefind
from sugar-blog.
{
"type": "module",
"license": "BSD-3-Clause",
"dependencies": {
"vitepress": "1.2.0",
"vite-plugin-vitepress-auto-nav": "2.3.2",
"markdown-it-footnote": "4.0.0",
"markdown-it-mathjax3": "4.3.2",
"markdown-it-task-checkbox": "1.0.6",
"vitepress-plugin-pagefind": "0.3.0",
"pagefind": "1.1.0"
},
"scripts": {
"docs:dev": "vitepress dev doc",
"docs:build": "vitepress build doc",
"docs:preview": "vitepress preview doc"
}
}
基本上是,我的文本量比较大,一开始使用 vitepress 官方自带插件可编译成功,但是无法使用,点击搜索不起作用。我已经在环境变量指定了 --max-old-space-size
参数,否则会 oom。再去掉 vitepress-plugin-pagefind
和 pagefind
后可正常编译运行。
vite-plugin-vitepress-auto-nav
是自动生成侧边栏的插件。见 https://github.com/Xaviw/vite-plugin-vitepress-auto-nav
from sugar-blog.
本地无法编译的原因找到了,https://cn.vitejs.dev/guide/troubleshooting.html#requests-are-stalled-forever
from sugar-blog.
本地无法编译的原因找到了,https://cn.vitejs.dev/guide/troubleshooting.html#requests-are-stalled-forever
修改后有解决你的问题吗。
from sugar-blog.
本地无法编译的原因找到了,https://cn.vitejs.dev/guide/troubleshooting.html#requests-are-stalled-forever
修改后有解决你的问题吗。
未解决,因为这个只是本地无法编译(默认文件系统有限制)。GitHub Action 一直可以编译并且会有报错。
from sugar-blog.
OK 我记一下,晚点拿你那个仓库我试一下
from sugar-blog.
我也遇到了 ,可能是写bug 了。
from sugar-blog.
可能不是这样,这个项目对于 vitepress 似乎看起来有些大了。即使是可能只有2000多个页面。我试过其他的官方文档的其他插件,都存在这些问题。他们是能编译出来,也有搜索框,但是搜索完全没反应。我一直在寻找优化的办法,但是还没有找到。如果你在编译的时候卡住了这可能是正常的(按照上面的链接解决文件系统的限制后),因为这个我本地 build 就一直过不去。CPU 会长时间 100%,可能是系统有问题,但是我使用的系统也是和 GitHub Action 一样的 24.04,各种软件版本也是一致的。但是 GitHub action 就能成功编译。
from sugar-blog.
辛苦你使用最新的 [email protected] 再试试嘞,周末我更新了一下,解决了一那个构建阻塞的问题。
from sugar-blog.
辛苦你使用最新的 [email protected] 再试试嘞,周末我更新了一下,解决了一那个构建阻塞的问题。
现在可以编译了,见https://taophilosophy.github.io/。但是所有搜索结果只有一条:#只有在构建后才生效 only support after build, only support after support
,目前 GitHub action 使用的已经是 build 了,辛苦再看看。
from sugar-blog.
辛苦你使用最新的 [email protected] 再试试嘞,周末我更新了一下,解决了一那个构建阻塞的问题。
现在可以编译了,见https://taophilosophy.github.io/。但是所有搜索结果只有一条:`#只有在构建后才生效 only support after build, only support after support`,目前 GitHub action 使用的已经是 build 了,辛苦再看看。
我看了一下日志发现没有如预期的执行 pagefind,你看看在项目里把 pagefind 依赖装上,然后修改一下构建指令
① 装依赖
pnpm add pagefind
② 构建指令添加索引生成
{
"scripts": {
"docs:build": "vitepress build docs && npx pagefind --site docs/.vitepress/dist"
}
}
③插件配置改一下
pagefindPlugin({searchOptimization:false})
from sugar-blog.
辛苦你使用最新的 [email protected] 再试试嘞,周末我更新了一下,解决了一那个构建阻塞的问题。
现在可以编译了,见https://taophilosophy.github.io/。但是所有搜索结果只有一条:`#只有在构建后才生效 only support after build, only support after support`,目前 GitHub action 使用的已经是 build 了,辛苦再看看。
我看了一下日志发现没有如预期的执行 pagefind,你看看在项目里把 pagefind 依赖装上,然后修改一下构建指令
① 装依赖
pnpm add pagefind② 构建指令添加索引生成
{ "scripts": { "docs:build": "vitepress build docs && npx pagefind --site docs/.vitepress/dist" } }③插件配置改一下
pagefindPlugin({searchOptimization:false})
在配置后,生成的 pc 端页面搜索框无法点击。移动端可以点击,搜索结果是 #只有在构建后才生效 only support after build, only support after support
。已经去掉了我自己配置的多余的 CSS。麻烦有时间再看看。非常感谢你。
from sugar-blog.
@ykla 迭代了一版,有空你再试试看
from sugar-blog.
你好,本地测了一下,PC 界面无法点击搜框索。移动端可以点击,搜索结果是 #只有在构建后才生效 only support after build, only support after support。
{
"type": "module",
"license": "BSD-3-Clause",
"dependencies": {
"vitepress": "1.2.2",
"vite-plugin-vitepress-auto-nav": "2.3.2",
"markdown-it-footnote": "4.0.0",
"markdown-it-mathjax3-tao": "4.3.2",
"pagefind": "1.1.0",
"markdown-it-task-checkbox": "1.0.6",
"vitepress-plugin-pagefind": "0.4.0"
},
"trustedDependencies": [
"markdown-it-mathjax3-tao",
"vitepress-plugin-pagefind",
"esbuild",
"vue-demi"
],
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs && pagefind --site docs/.vitepress/dist",
"docs:preview": "vitepress preview docs",
"docs:serve": "vitepress serve docs --port 8080"
}
}
ykla@ykla-ubuntu:~/taophilosophy.github.io$ bun install
bun install v1.1.12-canary.1 (43f0913c)
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
+ [email protected]
167 packages installed [2.99s]
ykla@ykla-ubuntu:~/taophilosophy.github.io$
ykla@ykla-ubuntu:~/taophilosophy.github.io$ bun --bun run docs:build
$ vitepress build docs && pagefind --site docs/.vitepress/dist
vitepress v1.2.2
⠋ building client + server bundles...🎈 SUMMARY 解析中...
🎈 SUMMARY 解析完成...
⠸ building client + server bundles...🎈 SUMMARY 解析中...
🎈 SUMMARY 解析完成...
✓ building client + server bundles...
✓ rendering pages...
✓ generating sitemap...
build complete in 589.29s.
Running Pagefind v1.1.0 (Extended)
Running from: "/home/ykla/taophilosophy.github.io"
Source: "docs/.vitepress/dist"
Output: "docs/.vitepress/dist/pagefind"
[Walking source directory]
Found 2620 files matching **/*.{html}
[Parsing files]
Found a data-pagefind-body element on the site.
↳ Ignoring pages without this tag.
[Reading languages]
Discovered 1 language: zh-cn
[Building search indexes]
Total:
Indexed 1 language
Indexed 2619 pages
Indexed 232865 words
Indexed 0 filters
Indexed 0 sorts
Finished in 343.737 seconds
ykla@ykla-ubuntu:~/taophilosophy.github.io$ bun --bun run docs:serve
$ vitepress serve docs --port 8080
vitepress v1.2.2
Built site served at http://localhost:8080/
^C
ykla@ykla-ubuntu:~/taophilosophy.github.io$
from sugar-blog.
好滴,我看你截图里的日志 索引文件时正常生成了的 我看一下是不是哪块配置没对上
from sugar-blog.
你看看你的构建产物里有这个目录吗?
from sugar-blog.
你看看你的构建产物里有这个目录吗?
你好,有的。
ykla@ykla-ubuntu:~/taophilosophy.github.io/docs/.vitepress/dist$ ls
404.html e index.html o SUMMARY.html
a f j p t
assets favicon.ico k pagefind u
b g l q v
c guan-yu logo.svg qian-yan w
CODE_OF_CONDUCT.html h m r x
CONTRIBUTING.html hashmap.json mu-lu-s.html s y
d i n sitemap.xml z
ykla@ykla-ubuntu:~/taophilosophy.github.io/docs/.vitepress/dist$ du -h pagefind/
68M pagefind/fragment
70M pagefind/index
137M pagefind/
from sugar-blog.
我估计是插件的 transformHead 钩子没有被执行.
你手动配一下可以,配置如下
import { defineConfig } from 'vitepress'
export default defineConfig({
head: [
[
'script',
{},
`import('/pagefind/pagefind.js')
.then((module) => {
window.__pagefind__ = module
module.init()
})
.catch(() => {
// console.log('not load /pagefind/pagefind.js')
})`
]
]
})
from sugar-blog.
经过测试加上后可以搜索了。非常感谢。
from sugar-blog.
回头这块 我出一个 SOP,针对插件内部分能力失效的地方
from sugar-blog.
又迭代了一版本 [email protected]
有空你可以试试能不能单独使用,
如果还是不能正常工作 你就可以按照现在的方式使用我也补到文档里了 示例 7
from sugar-blog.
Related Issues (20)
- 标签bug HOT 2
- 文章frontMatter使用本地cover,部署后在index页面图片路径错误 HOT 2
- [idea]右侧导航栏能否实现固定,不随着文章列表的滚动而随之滚动 HOT 4
- index.md问题 HOT 7
- Mermaid流程图打包问题 HOT 1
- [feat] vitepress-plugin-pagefind 可否增加类似 minisearch 的搜索预览 HOT 4
- 若干个问题 HOT 3
- 首页精选文章跳转错误的问题 HOT 3
- 更新0.2.30,mac打包内存溢出 HOT 9
- 文案错误 HOT 1
- 能否把 pagefind 作为依赖自动安装 HOT 2
- Typo HOT 2
- 如果我有一系列的文档需要vitepress官方那种左侧导航栏的怎么做 HOT 5
- vitepress-plugin-pagefind: v0.4.4 breaks rendering HOT 8
- pagefind插件,如果md中出现<script setup lang="ts">标签将无法索引 HOT 9
- vitepress-plugin-pagefind: v0.4.4 broke dynamic route pages HOT 1
- RSS 文件内容出现乱码问题 HOT 3
- 请问一下大佬,如何修改底部栏呢? HOT 1
- 更新依赖后,SASS 会报警告 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sugar-blog.