diff --git a/README.md b/README.md index 0301179..2ff7f80 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,12 @@ cover: # ProgressBar progressBar: true +# Boardcast +broadcast: + enable: true + type: 2 # 1:custom,2:hitokoto api(https://hitokoto.cn/) + text: a clean and elegant theme, fast and responsive. # only work in custom mode + # Article Setting # (Use this to excerpt if article is too long:) excerpt_link: Read More... diff --git a/_config.yml b/_config.yml index 43ebe82..8de59e8 100644 --- a/_config.yml +++ b/_config.yml @@ -35,6 +35,12 @@ cover: # 页面顶部进度条 progressBar: true +# 告示板模块 +broadcast: + enable: true # true开启,false关闭 + type: 2 # 1:自定义输入,2:一言api(https://hitokoto.cn/) + text: 一个安静优雅的hexo主题,快速且响应式。 # type为1时有效 + # 文章配置 # 文章太长,截断按钮文字(在需要截断的行增加此标记:) excerpt_link: 阅读更多... diff --git a/layout/_partial/archive.ejs b/layout/_partial/archive.ejs index dfddfa9..3d56c6a 100644 --- a/layout/_partial/archive.ejs +++ b/layout/_partial/archive.ejs @@ -1,4 +1,7 @@
+ <% if (theme.broadcast.enable && pagination == 2){ %> + <%- partial('_partial/broadcast') %> + <% } %>
<% var title = ''; diff --git a/layout/_partial/broadcast.ejs b/layout/_partial/broadcast.ejs new file mode 100644 index 0000000..fc81915 --- /dev/null +++ b/layout/_partial/broadcast.ejs @@ -0,0 +1,46 @@ +<% if (theme.broadcast.type===1 && theme.broadcast.text){ %> +
+ +
<%= theme.broadcast.text %>
+
+<% } %> +<% if (theme.broadcast.type===2){ %> +
+ +
+
+ +<% } %> + \ No newline at end of file