V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OneEarMouse
V2EX  ›  程序员

踩坑: VuePress 与 Cloudflare Pages 的奇妙冲突,无法使用 giscus

  •  
  •   OneEarMouse · 11 天前 · 793 次点击

    搞了一下午总算搞明白为什么了

    原文连接: https://www.oneearmouse.com/posts/VuePress-cloudflarepage-conflict.html

    太长不看总结:

    1. VuePress 默认路由系统后缀为.html
    2. Cloudflare Pages 默认重定向.html 后缀

    因此会发生

    太蠢了,准备把 vuepress 换了或者换回 github page 了

    4 条回复    2024-04-28 09:57:49 +08:00
    epiloguess
        1
    epiloguess  
       11 天前 via Android
    cloudflare 可以设置转发规则的,或许可以帮到你
    v23xowen
        2
    v23xowen  
       11 天前
    https://vuepress.vuejs.org/zh/config/#markdown-pagesuffix
    vuepress 有插件支持生成简洁的 URL 不知道满足你的需求不。

    用 vitepress 吧,vuepress 都不怎么更新了
    https://vitepress.dev/zh/guide/routing#generating-clean-url
    OneEarMouse
        3
    OneEarMouse  
    OP
       11 天前
    @epiloguess 主要这个问题还影响 google seo 了,抓的 url 都是不带.html 的,不能跳转。转发规则不一定有用


    @v23xowen 感谢帮忙。但这个插件好像是 vuepress1 的,我用的 vuepress2 里已经移除了。我个人用下来感觉 vuepress 这类比较适合写文档,不适合写博客。可能考虑换 hugo
    Opportunity
        4
    Opportunity  
       11 天前
    只能说 Cloudflare Pages 确实很特立独行 https://github.com/slorber/trailing-slash-guide
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5557 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 08:19 · PVG 16:19 · LAX 01:19 · JFK 04:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.