支持自己添加列表类侧边栏控件

i18n
xaoxuu 6 years ago
parent efa2ad2a5d
commit 546384f1b9
  1. 12
      layout/_partial/side.ejs
  2. 2
      layout/_widget/author.ejs
  3. 2
      layout/_widget/categories.ejs
  4. 2
      layout/_widget/links.ejs
  5. 2
      layout/_widget/music.ejs
  6. 2
      layout/_widget/tagcloud.ejs
  7. 2
      layout/_widget/toc.ejs
  8. 2
      source/less/_toc.less
  9. 36
      source/less/_widget.less

@ -4,7 +4,7 @@
<% } %>
<% if (config.widgets){ %>
<% (config.widgets||[]).forEach(function(item){ %>
<section class='m_widget' id='mywidget'>
<section class='mywidget' id='<%- item.type ? item.type : '' %>'>
<% 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>
@ -15,7 +15,15 @@
</header>
<%} %>
<div class='content <%= theme.style %>'>
<%- item.body %>
<% if(item.type == 'list') { %>
<ul class="entry">
<% (item.rows||[]).forEach(function(row){ %>
<li><a class="flat-box" href="<%= url_for(row.url) %>"><i class="<%= row.icon %> fa-fw"></i><div class='name'><%= row.name %></div></a>
<% }) %>
</ul>
<% } else { %>
<%- item.body %>
<% } %>
</div>
</section>
<% }) %>

@ -1,5 +1,5 @@
<% if(theme.widgets.author.enable != false) { %>
<section class='m_widget' id='author'>
<section class='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' id='categories'>
<section class='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' id='links'>
<section class='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) { %>

@ -39,7 +39,7 @@ if (theme.widgets.music && theme.widgets.music.display) {
%>
<% if (needDisplay == true) { %>
<section class='m_widget' id='music'>
<section class='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' id='tagcloud'>
<section class='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>

@ -1,5 +1,5 @@
<% if(page.layout == 'post' && page.content && page.toc!==false && toc(page.content).length > 0){ %>
<section class='m_widget toc-wrapper'>
<section class='toc-wrapper'>
<header class="header <%= theme.style %>">
<div><i class="<%= theme.widgets.toc.icon %> fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;<%= theme.widgets.toc.title %></div>
<div class='wrapper'><a class="s-toc rightBtn" title="固定到顶部" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>

@ -1,4 +1,4 @@
.m_widget.toc-wrapper{
.l_side .toc-wrapper{
z-index: 1;
overflow: auto;
border-radius: @border_radius;

@ -1,4 +1,4 @@
.m_widget{
.l_side section{
z-index: 0;
&:extend(.z-depth-main);
background: @theme_cardbg;
@ -70,7 +70,7 @@
max-height: ~"calc(100% - @{height_navbar} - 12.5 * @{gap})";
ul.entry > li > a{
padding: 0 @gap;
line-height:@height_cell;
line-height: @height_cell;
height: @height_cell;
display: flex;
justify-content: space-between;
@ -98,7 +98,7 @@
}
&#author{
&.author{
.enable-trans();
h2{
text-align: center;
@ -178,7 +178,8 @@
}
}
&#mywidget{
&.mywidget{
.content{
font-size: @fontsize_small;
font-weight: bold;
@ -200,9 +201,28 @@
}
}
}
&#list{
.content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a{
&:hover{
text-decoration: none;
}
i{
color: fade(@color_text_main,70%);
line-height: @height_cell;
margin-right: 8px;
}
}
}
}
}
&#categories{
&.categories{
.content{
padding: @gap/2 0;
&.pure{
@ -211,7 +231,7 @@
}
}
&#tagcloud{
&.tagcloud{
.content{
text-align: justify;
padding: @gap/2 @gap;
@ -230,7 +250,7 @@
}
}
&#music{
&.music{
.header{
&.pure{
padding-bottom: @gap/4; // 适合白色导航栏背景
@ -249,7 +269,7 @@
}
&#links{
&.links{
.header{
.rightBtn{
&:hover{

Loading…
Cancel
Save