Closed SilenceOverflow closed 6 years ago
我觉得这可能和 href
这个属性有关,
有两个解决方案:
href="/category/#Computer Science"
代替 href="#Computer Science"
,缺点是每次都要重新访问
<ul id="content-side" class="content-ul">
{% for category in site.categories%}
<li>
<a data-scroll href="#{{ category | first }}">
{{ category | first }} ({{ category | last | size }})
</a>
</li>
{% endfor %}
</ul>
把 page/1category.html
里的这句话 <a data-scroll href="#{{ category | first }}">
修改一下
@TangMingliang95 谢谢你的回复。
href="/category/#{{ category | first }}
后,所有的超链接均失效。@YoujieXia 我自己测试不用做任何修改,可以正常跳转。你出问题的原因是没有及时更新模板。
事实上, @Gaohaoyang 在二月的提交update scroll smooth中已经把滚动方法改为使用data-scroll,而你还是使用旧版本的"scroll" class,所以出了问题。
更新相关文件应该可以解决你的问题。
@TangMingliang95 非常感谢!根据update scroll smooth的记录已经修复了此问题。
@Gaohaoyang 我已经close该issue,谢谢!
“A B”
形式,中间有空格:“A B”
无法对应到当页正确位置,无空格则没问题。PS: 我看过
index.html
和/_includes/category.html
里面对应的代码,可是本人技术比较渣,改了几次没改对,求助。。。