i18n
xaoxuu 6 years ago
parent c46eac7992
commit f2a691420a
  1. 4
      _config.yml
  2. 3
      layout/_partial/side.ejs
  3. 10
      layout/_widget/announcement.ejs
  4. 15
      source/less/_widget.less

@ -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

@ -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') %>
<% } %>

@ -0,0 +1,10 @@
<% if(theme.widgets.announcement.enable == true && config.announcement) { %>
<section class='m_widget announcement'>
<header class='header <%= theme.style %>'>
<div><i class="<%= theme.widgets.announcement.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.announcement.title %></div>
</header>
<div class='content <%= theme.style %>'>
<%- config.announcement %>
</div>
</section>
<% } %>

@ -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;

Loading…
Cancel
Save