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

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

@ -1,5 +1,5 @@
<% if(theme.widgets.author.enable != false) { %> <% if(theme.widgets.author.enable != false) { %>
<section class='m_widget author'> <section class='m_widget' id='author'>
<% if(theme.widgets.author.avatar) { %> <% if(theme.widgets.author.avatar) { %>
<div class='header'> <div class='header'>
<img class='avatar' src='<%= url_for(config.avatar ? config.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/> <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 %>'> <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> <div><i class="<%= theme.widgets.categories.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.categories.title %></div>
</header> </header>

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

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

Loading…
Cancel
Save