diff --git a/_config.yml b/_config.yml index e2cde04..4f44ad6 100755 --- a/_config.yml +++ b/_config.yml @@ -65,6 +65,10 @@ widgets: title: false # 是否显示博客名、头衔等等。如果是,需要在主目录的config中写title motto: false # 是否显示格言座右铭等等。如果是,需要在主目录的config中写motto social: true # 是否显示社交信息(内容同页脚的社交信息)如果是,需要在主目录的config中写social,支持icon和URL + announcement: + enable: true + icon: fas fa-bullhorn + title: "公告" # 显示文章分类 categories: enable: true diff --git a/layout/_partial/side.ejs b/layout/_partial/side.ejs index 32b8812..87e1281 100755 --- a/layout/_partial/side.ejs +++ b/layout/_partial/side.ejs @@ -2,6 +2,9 @@ <% if (theme.widgets.author.enable){ %> <%- partial('../_widget/author') %> <% } %> + <% if (theme.widgets.categories.enable){ %> + <%- partial('../_widget/announcement') %> + <% } %> <% if (theme.widgets.categories.enable){ %> <%- partial('../_widget/categories') %> <% } %> diff --git a/layout/_widget/announcement.ejs b/layout/_widget/announcement.ejs new file mode 100755 index 0000000..eee3c83 --- /dev/null +++ b/layout/_widget/announcement.ejs @@ -0,0 +1,10 @@ +<% if(theme.widgets.announcement.enable == true && config.announcement) { %> +
+
+
  <%= theme.widgets.announcement.title %>
+
+
+ <%- config.announcement %> +
+
+<% } %> diff --git a/source/less/_widget.less b/source/less/_widget.less index 13c07c0..155ba3e 100755 --- a/source/less/_widget.less +++ b/source/less/_widget.less @@ -163,6 +163,21 @@ } } +.m_widget.announcement{ + .content{ + word-break: break-all; + padding: @gap/2 @gap; + &.pure{ + padding: 0 @gap @gap @gap; // 适合白色导航栏背景 + } + a{ + color: @theme_base_tint; + &:hover { + color: darken(@theme_text_highlight, 25%); + } + } + } +} .m_widget.categories{ .content{ padding: @gap/2 0;