• 请不要在回答技术问题时复制粘贴 AI 生成的内容
OneEarMouse
V2EX  ›  程序员

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

  •  
  •   OneEarMouse · Apr 27, 2024 · 2280 views
    This topic created in 776 days ago, the information mentioned may be changed or developed.

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

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

    太长不看总结:

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

    因此会发生

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

    4 replies    2024-04-28 09:57:49 +08:00
    epiloguess
        1
    epiloguess  
       Apr 27, 2024 via Android
    cloudflare 可以设置转发规则的,或许可以帮到你
    v23xowen
        2
    v23xowen  
       Apr 27, 2024
    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
       Apr 27, 2024
    @epiloguess 主要这个问题还影响 google seo 了,抓的 url 都是不带.html 的,不能跳转。转发规则不一定有用


    @v23xowen 感谢帮忙。但这个插件好像是 vuepress1 的,我用的 vuepress2 里已经移除了。我个人用下来感觉 vuepress 这类比较适合写文档,不适合写博客。可能考虑换 hugo
    Opportunity
        4
    Opportunity  
       Apr 28, 2024
    只能说 Cloudflare Pages 确实很特立独行 https://github.com/slorber/trailing-slash-guide
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   991 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 18:58 · PVG 02:58 · LAX 11:58 · JFK 14:58
    ♥ Do have faith in what you're doing.