Gaohaoyang / gaohaoyang.github.io

blog & blog theme🤘
http://gaohaoyang.github.io
MIT License
1.89k stars 2k forks source link

Category关键词有空格导致超链接问题? #70

Closed SilenceOverflow closed 6 years ago

SilenceOverflow commented 7 years ago

PS: 我看过 index.html/_includes/category.html里面对应的代码,可是本人技术比较渣,改了几次没改对,求助。。。

TangMingliang95 commented 7 years ago

我觉得这可能和 href 这个属性有关, 有两个解决方案:

  1. 不使用空格
  2. 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 }}"> 修改一下

SilenceOverflow commented 7 years ago

@TangMingliang95 谢谢你的回复。

TangMingliang95 commented 7 years ago

@YoujieXia 我自己测试不用做任何修改,可以正常跳转。你出问题的原因是没有及时更新模板。

事实上, @Gaohaoyang 在二月的提交update scroll smooth中已经把滚动方法改为使用data-scroll,而你还是使用旧版本的"scroll" class,所以出了问题。

更新相关文件应该可以解决你的问题。

SilenceOverflow commented 6 years ago

@TangMingliang95 非常感谢!根据update scroll smooth的记录已经修复了此问题。

@Gaohaoyang 我已经close该issue,谢谢!