摘要
- 在tools.ejs文件里找到以下代码:
1
2
3
4
5
6
7
8<% for (var i in theme.friends){ %>
<li class="search-li">
<a href="<%- url_for(theme.friends[i]) %>" target="_blank" style="color:#969696" class="search-title"><i class="icon"></i>
<%if( url_for(theme.friends[i]) ){%>
<%= i %></a>
<% } %>
</li>
<% } %> - 将<%= i %>前面加上以下代码:
1
<img class="imgUrl" src="<%= url_for(theme.friends[i]) + 'favicon.ico' %>" alt="icon" height="25" width="25" />   
- 将tools.ejs文件尾部加上以下代码:这样,就为友链增加了头像,后续优化,待定…
1
2
3
4
5
6
7
8<script type="text/javascript">
t = document.getElementsByClassName("imgUrl");
for(i = 0; i < t.length; i++){
t.item(i).onerror = function(){
this.src = "https://GH670.github.io/F3yaX.png"
}
}
</script>参考:链接失效…
本文作者:
GH670
发布时间: 2020-05-07
最后更新: 2020-05-11
本文标题: Hexo-友链样式的优化
本文链接: www.wblog.tech/hexo-youlianyouhua.html
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可。转载请注明出处!
发布时间: 2020-05-07
最后更新: 2020-05-11
本文标题: Hexo-友链样式的优化
本文链接: www.wblog.tech/hexo-youlianyouhua.html
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可。转载请注明出处!
