明 光 大 正

hexo下的第一篇blog

    hexo设置

自定义图标的问题

很多人说将themes/主题名称/layout/_partial/head.ejs中的

1
<link href="<%- config.root %>favicon.png" rel="icon">

替换为

1
<link href="<%- config.root %>favicon.ico" rel="icon" type="image/x-ico">

好像在hexo3下无效了,因为找不到类似的语句

我的做法
在同样的位置现在的写法是

1
2
3
<% if (theme.favicon){ %>
<link rel="icon" href="<%- theme.favicon %>">
<% } %>

所以在对应位置放一个favicon.ico的图标就可以了,在主题目录的source文件夹下。

多说评论框设置

先在_config.yml下添加duoshuo_shortname,在article.ejs中调用

在主题/layout/_partial/article.ejs的最后一段替换如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<% if (!index && post.comments && config.duoshuo_shortname){ %>
<section id="comments">
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="<%= post.layout %>-<%= post.slug %>" data-title="<%= post.title %>" data-url="<%= page.permalink %>"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:'<%= config.duoshuo_shortname %>'};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
</section>
<% } %>

个人页面添加

在主题/_config.yml中的menu中添加 About: /about

我这个页面的mathjax规则

在单行模式下,也就是两个美元符号之间,

  • 下划线需要转义
  • 大括号是用两个反斜杠转义

在插入模式下,也就是四个美元符号之间,

  • 可以直接用latex的大括号
  • 下滑线不用转义
  • 包含于符号需要空格
页阅读量:  ・  站访问量:  ・  站访客数: