hexo侧边栏安装最近评论小物件

前提:你的hexo已经配置了多说

themes/landscape-plus/layout/_widget目录下新建小物件duoshuo_recent_comments.ejs,编辑如下:

1
2
3
4
5
6
7
8
<% if (theme.duoshuo_shortname){ %>
<div class="widget-wrap">
<h3 class="widget-title">最近评论</h3>
<div class="widget">
<ul class="ds-recent-comments" data-num-items="5" data-show-avatars="1" data-show-time="1" data-show-title="1" data-show-admin="1" data-excerpt-length="70"></ul>
</div>
</div>
<% } %>

再修改主题的配置themes/landscape-plus/_config.yml

1
2
3
4
5
6
7
8
9
10
# Sidebar
sidebar: right
widgets:
- recent_posts
- category
- tag
- tagcloud
- archive
- links
- duoshuo_recent_comments //与小物件的名称保持一致
文章目录