i18n
xaoxuu 6 years ago
parent 5ccecd437d
commit 6b4218101f
  1. 6
      _config.yml
  2. 9
      layout/_partial/side.ejs
  3. 2
      layout/_widget/author.ejs
  4. 2
      layout/_widget/categories.ejs
  5. 2
      layout/_widget/links.ejs
  6. 2
      layout/_widget/music.ejs
  7. 2
      layout/_widget/tagcloud.ejs
  8. 287
      source/less/_widget.less

@ -29,8 +29,10 @@ nav_menu:
# widgets:
# - icon: fas fa-bullhorn
# title: 注意啦
# body: '本站使用 <b><a href="https://xaoxuu.com/wiki/material-x/">Material X</a></b> 作为主题,喜欢这个主题的朋友可以阅读文档进行安装哦。超喜欢的话还可以安利给身边的朋友哦。'
# url: https://xaoxuu.com/wiki/material-x/
# body: '本站使用 <b><a href="https://xaoxuu.com/wiki/material-x/">Material X</a></b> 作为主题,喜欢这个主题的朋友可以阅读文档进行安装哦,超喜欢的话还可以安利给身边的朋友哦~'
# more: # 可选,默认为空
# icon: fas fa-question-circle # 可选,默认为“fas fa-question-circle”
# url: https://xaoxuu.com/wiki/material-x/
# 友链的写法示例
links:

@ -4,13 +4,16 @@
<% } %>
<% if (config.widgets){ %>
<% (config.widgets||[]).forEach(function(item){ %>
<section class='m_widget mywidgets'>
<section class='m_widget' id='mywidget'>
<% if(item.icon && item.title) { %>
<header class='header <%= theme.style %>'>
<div><i class="<%= item.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= item.title %></div>
<% if(item.url) { %>
<a class="rightBtn" target="_blank" rel="external nofollow noopener noreferrer" href="<%= item.url %>"><i class="fas fa-question-circle fa-fw"></i></a>
<% if(item.more && item.more.url) { %>
<a class="rightBtn" target="_blank" rel="external nofollow noopener noreferrer" href="<%= item.more.url %>">
<i class="<%= item.more.icon?item.more.icon:'fas fa-question-circle' %> fa-fw"></i></a>
<%} %>
</header>
<%} %>
<div class='content <%= theme.style %>'>
<%- item.body %>
</div>

@ -1,5 +1,5 @@
<% if(theme.widgets.author.enable != false) { %>
<section class='m_widget author'>
<section class='m_widget' id='author'>
<% if(theme.widgets.author.avatar) { %>
<div class='header'>
<img class='avatar' src='<%= url_for(config.avatar ? config.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/>

@ -1,4 +1,4 @@
<section class='m_widget categories'>
<section class='m_widget' id='categories'>
<header class='header <%= theme.style %>'>
<div><i class="<%= theme.widgets.categories.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.categories.title %></div>
</header>

@ -1,4 +1,4 @@
<section class='m_widget links'>
<section class='m_widget' id='links'>
<header class='header <%= theme.style %>'>
<div><i class="<%= theme.widgets.links.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.links.title %></div>
<% if(config.title && theme.widgets.links.mailto) { %>

@ -1,4 +1,4 @@
<section class='m_widget music'>
<section class='m_widget' id='music'>
<header class='header <%= theme.style %>'>
<div><i class="<%= theme.widgets.music.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.music.title %></div>
<a class="rightBtn" target="_blank" rel="external nofollow noopener noreferrer" href="<%= theme.widgets.music.link %>"><i class="far fa-heart fa-fw"></i></a>

@ -1,5 +1,5 @@
<% if (site.tags.length){ %>
<section class='m_widget tagcloud'>
<section class='m_widget' id='tagcloud'>
<header class="header <%= theme.style %>">
<div><i class="<%= theme.widgets.tagcloud.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.tagcloud.title %></div>
</header>

@ -93,174 +93,171 @@
}
}
.m_widget.author{
.enable-trans();
h2{
text-align: center;
// color: @color_text_header;
}
.header{
padding: 0;
margin: 0;
display: flex;
justify-content: center;
background-color: transparent;
@media(max-width: @on_phone){
padding: @gap/2;
&#author{
.enable-trans();
h2{
text-align: center;
// color: @color_text_header;
}
}
img{
width: @width_sidebar;
height: @width_sidebar;
@media(max-width: @on_phone){
width: 80px;
height: 80px;
border-radius: 100%;
margin-top: @gap/2;
.header{
padding: 0;
margin: 0;
display: flex;
justify-content: center;
background-color: transparent;
@media(max-width: @on_phone){
padding: @gap/2;
}
}
border-top-left-radius: @border_radius;
border-top-right-radius: @border_radius;
}
.content{
p{
font-size: @fontsize_base;
text-align: center;
}
text-align: center;
font-weight: bold;
padding-bottom: 0;
padding: @gap/2 @gap 0 @gap;
@media(max-width: @on_phone){
padding: @gap/2 @gap;
img{
width: @width_sidebar;
height: @width_sidebar;
@media(max-width: @on_phone){
width: 80px;
height: 80px;
border-radius: 100%;
margin-top: @gap/2;
}
border-top-left-radius: @border_radius;
border-top-right-radius: @border_radius;
}
}
.social-wrapper{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 4px @gap/2;
a {
color: fade(@color_text_main, 70%);
.enable-trans();
&:hover {
color: @color_text_highlight;
.content{
p{
font-size: @fontsize_base;
text-align: center;
}
text-align: center;
font-weight: bold;
padding-bottom: 0;
padding: @gap/2 @gap 0 @gap;
@media(max-width: @on_phone){
padding: @gap/2 @gap;
}
&.social {
display: flex;
justify-content: center;
align-items: center;
width: 32px;
height: 32px;
margin: 4px;
border-radius: 100px;
}
.social-wrapper{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
padding: 4px @gap/2;
a {
color: fade(@color_text_main, 70%);
.enable-trans();
&:hover {
background: fade(@theme_main, 10%);
color: @theme_main;
color: @color_text_highlight;
}
&.social {
display: flex;
justify-content: center;
align-items: center;
width: 32px;
height: 32px;
margin: 4px;
border-radius: 100px;
&:hover {
background: fade(@theme_main, 10%);
color: @theme_main;
}
}
}
}
}
}
.m_widget.mywidgets{
.content{
font-size: @fontsize_small;
font-weight: bold;
word-break: break-all;
padding: @gap/2 @gap;
line-height: @fontsize_small + 8px;
&.pure{
padding: 0 @gap @gap @gap; // 适合白色导航栏背景
}
a{
color: @color_text_link;
.enable-trans();
&:hover {
color: @color_text_highlight;
text-decoration: underline;
}
&:active {
color: darken(@color_text_highlight, 25%);
}
&#mywidget{
.content{
font-size: @fontsize_small;
font-weight: bold;
word-break: break-all;
padding: @gap/2 @gap;
line-height: @fontsize_small + 8px;
&.pure{
padding: 0 @gap @gap @gap; // 适合白色导航栏背景
}
a{
color: @color_text_link;
.enable-trans();
&:hover {
color: @color_text_highlight;
text-decoration: underline;
}
&:active {
color: darken(@color_text_highlight, 25%);
}
}
}
}
}
.m_widget.categories{
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
}
}
.m_widget.tagcloud{
.content{
text-align: justify;
padding: @gap/2 @gap;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a{
display:inline-block;
.enable-trans(.1s);
line-height: 1.6em;
&:hover{
color: @color_text_highlight !important; //to cover inline style.
text-decoration: underline
&#categories{
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
}
}
}
.m_widget.contacts{
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
}
}
.m_widget.music{
.header{
&.pure{
padding-bottom: @gap/4; // 适合白色导航栏背景
}
}
.content{
padding: @gap/2+4px;
padding-top: @gap/2;
&.pure{
padding-top: @gap/4; // 适合白色导航栏背景
}
.aplayer{
border-radius: 4px;
&#tagcloud{
.content{
text-align: justify;
padding: @gap/2 @gap;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a{
display:inline-block;
.enable-trans(.1s);
line-height: 1.6em;
&:hover{
color: @color_text_highlight !important; //to cover inline style.
text-decoration: underline
}
}
}
}
}
.m_widget.links{
.header{
.rightBtn{
&:hover{
transform: rotate(90deg);
&#music{
.header{
&.pure{
padding-bottom: @gap/4; // 适合白色导航栏背景
}
}
.content{
padding: @gap/2+4px;
padding-top: @gap/2;
&.pure{
padding-top: @gap/4; // 适合白色导航栏背景
}
.aplayer{
border-radius: 4px;
}
}
}
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
&#links{
.header{
.rightBtn{
&:hover{
transform: rotate(90deg);
}
}
}
.name{
img{
display: inline;
border-radius: 100%;
vertical-align: middle;
height: 18px;
width: 18px;
margin-bottom: 4px;
}
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
.name{
img{
display: inline;
border-radius: 100%;
vertical-align: middle;
height: 18px;
width: 18px;
margin-bottom: 4px;
}
}
}
}
}

Loading…
Cancel
Save