hexo-theme-huweihuang icon indicating copy to clipboard operation
hexo-theme-huweihuang copied to clipboard

推荐使用toc函数锚点 更准确

Open leeningzzu opened this issue 5 years ago • 4 comments

  1. 删除package.json内hexo-toc信息
  2. 在config.yml内如下添加anchors信息启动toc函数
markdown:
  render:
    html: true
    xhtmlOut: false
    breaks: true
    linkify: true
    typographer: true
    quotes: '“”‘’'
  anchors:
    level: 1
    permalinkSymbol: '' 

可解决用hexo-toc插件中文定位出现undefined问题``

leeningzzu avatar Apr 01 '19 10:04 leeningzzu

这个可以,但是定位效果好像比较生硬,没有smooth效果

nqmysb avatar Apr 01 '19 12:04 nqmysb

@nqmysb 非常感谢 我用的是toc+smooth函数的结合版 可以实现类似于这种滚动监听的效果嘛https://mensu.github.io/2016/08/11/test-long-catalog-dynamo-amazons-ha-kv-store-ZH.html

leeningzzu avatar Apr 05 '19 14:04 leeningzzu

@nqmysb 非常感谢 我用的是toc+smooth函数的结合版 可以实现类似于这种滚动监听的效果嘛https://mensu.github.io/2016/08/11/test-long-catalog-dynamo-amazons-ha-kv-store-ZH.html

能够说一下 toc + smooth 的实现吗?

hblolj avatar Jul 15 '19 08:07 hblolj

@nqmysb 非常感谢 我用的是toc+smooth函数的结合版 可以实现类似于这种滚动监听的效果嘛https://mensu.github.io/2016/08/11/test-long-catalog-dynamo-amazons-ha-kv-store-ZH.html

贴一下实现吧,感谢🙏

shifpeng avatar Mar 12 '21 08:03 shifpeng