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

网站在子目录下链接地址错乱

Open maobaolong opened this issue 8 years ago • 3 comments

主题配置中的root_url配置成/blog/ 博客目录的root和url也相应配置到blog子目录。 发现标签,关于等都不对了,链接地址里有重复blog,搜索出的结果也重复blog。

maobaolong avatar Jan 21 '17 14:01 maobaolong

补充说明,这是我的博客hexo工程 https://github.com/maobaolong/maobaolong

https://maobaolong.github.io/github_blog

maobaolong avatar Jan 21 '17 14:01 maobaolong

同样的问题,求解

Vccxx avatar Nov 20 '17 07:11 Vccxx

Some suggestions:

To fix "Tags" and "About me", change layout/_partial/left-col.ejs, line 73:

- <li><a href="<%- theme.root_url %><%- url_for(theme.menu[i]) %>"><%= i %></a></li>
+ <li><a href="<%- url_for(theme.menu[i]) %>"><%= i %></a></li>

To fix floating homepage buttons on the left side of the posts, change layout/_partial/post-nav-button.ejs, line 9 and 19:

- <a href="/" title="<%= __('tooltip.back2home') %>"><i class="fa fa-home"></i></a>
+ <a href="<%- url_for('/') %>" title="<%= __('tooltip.back2home') %>"><i class="fa fa-home"></i></a>

To fix the "Author" link in the copyright section, change layout/_partial/post/nav.ejs, line 4:

- <p><span><%= __('copyright_info.author') %>:</span><a href="/" title="<%= __('tooltip.back2home') %>"><%=theme.author%></a></p>
+ <p><span><%= __('copyright_info.author') %>:</span><a href="<%- url_for('/') %>" title="<%= __('tooltip.back2home') %>"><%=theme.author%></a></p>

The reason is that the function url_for() has already taken care of the root directory. Read more: https://hexo.io/docs/helpers.html#url-for

I've so far encountered those errors, but if there are other errors the solutions will be similar. Hope the author's gonna fix it soon.

maobowen avatar Jan 13 '18 22:01 maobowen