Vitepress 自动生成中文outline 大纲id

在通过vitepress 写博客的时候,对于中文title 生成的outline 大纲无法正常跳转,我们必须手动的去为中文title 设置一个英文id, 如下:

Custom anchors

To specify a custom anchor tag for a heading instead of using the auto-generated one, add a suffix to the heading:

# Using custom anchors {#my-anchor}

This allows you to link to the heading as #my-anchor instead of the default #using-custom-anchors.

对于大篇幅的文档内容来说这显然是一件比较麻烦的事情,官方对此也没有具体的方案。

对此我们可以修改源码来解决这个问题:

自动生成自定义ID,这样就不必对文档中的中文标题手动生成title id

但次方法比较“暴力” 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值