i18n
xaoxuu 6 years ago
parent fc723dcc11
commit 337d357969
  1. 47
      _config.yml
  2. 2
      layout/_partial/archive.ejs
  3. 2
      layout/_partial/side.ejs
  4. 28
      layout/_widget copy/author.ejs
  5. 14
      layout/_widget copy/categories.ejs
  6. 24
      layout/_widget copy/links.ejs
  7. 59
      layout/_widget copy/music.ejs
  8. 16
      layout/_widget copy/tagcloud.ejs
  9. 11
      layout/_widget copy/toc.ejs
  10. 12
      layout/_widget/music.ejs

@ -5,7 +5,7 @@ theme_info:
version: 1.0-beta10
docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址,如果你的源码托管到国内CDN可以更改此链接。如需启用CDN,请在主目录的config中设置import,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.29/
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.30/
##########################################################################
# 请务必阅读官方文档!!!
# 请务必阅读官方文档!!!
@ -15,29 +15,22 @@ theme_info:
# style: material # 导航栏和标题栏背景是主题色
style: pure # 导航栏和标题栏背景是白色
# 右边的小窗口,不想显示哪一项的把enable设置为false即可
# 这里的widgets字段是对widget的默认设置,如需修改请参照文档在主目录的config中写。
widgets:
# 博主信息区,是否显示个人头像、格言、社交信息等
author:
enable: true
avatar: true # 是否显示头像,如果是,需要在主目录的config中写avatar的URL
title: true # 是否显示博客名、头衔等等。如果是,需要在主目录的config中写title
motto: true # 是否显示格言座右铭等等。如果是,需要在主目录的config中写motto
social: true # 是否显示社交信息(内容同页脚的社交信息)如果是,需要在主目录的config中写social,支持icon和URL
# 显示文章分类
categories:
enable: true
# 文章分类的默认配置
category:
icon: fas fa-folder-open
title: "博文分类"
# 显示文章标签
# 文章标签的默认配置
tagcloud:
enable: true
icon: fas fa-tags
title: "热门话题"
# 显示音乐播放器
# 文章目录的默认配置
toc:
icon: fas fa-list
title: "目录"
# 音乐控件的默认配置
music:
enable: true
display: # 批量控制哪一类页面显示
home: false # 在主页是否显示
tag: false # 在标签页面是否显示
@ -46,26 +39,6 @@ widgets:
page: false # layout: page 的页面是否显示
links: true # layout: links 的页面是否显示
post: true # layout: post 的页面是否显示
icon: fas fa-compact-disc
title: "最近在听"
link: 'https://music.163.com/#/user/home?id=63035382'
color: '#3DC550' # 主题色
volume: 0.5 # 默认音量大小(0~1之间)
mode: circulation # random (随机) single (单曲) circulation (列表循环) order (列表)
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
type: playlist # song (单曲) album (专辑) playlist (歌单) search (搜索)
id: 746319661 # 歌曲/专辑/歌单 ID
# 显示友链,友链的内容写在主目录的config中
links:
enable: false
icon: fas fa-handshake
title: "友链"
mailto: "me@xaoxuu.com" # 右边显示➕ ,点击给这个地址发送邮件添加友链
# 显示目录(在文章中设置toc:false可以隐藏单篇文章的目录)
toc:
enable: true
icon: fas fa-list
title: "目录"
# 推荐文章

@ -8,7 +8,7 @@
</script>
<% } else if (is_category()) { %>
<script>
window.subData= { title:'<%= theme.widgets.categories.title %> : <%= page.category %>'}
window.subData= { title:'<%= theme.widgets.category.title %> : <%= page.category %>'}
</script>
<% } %>

@ -26,7 +26,7 @@
<% if (widget_name == 'toc') { %>
<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>
<% } else if(item.more && item.more.url) { %>
<a class="rightBtn<%- item.more.animation ? ' ' + item.more.animation : '' %>" target="_blank"
<a class="rightBtn<%- item.more.animate ? ' ' + item.more.animate : '' %>" target="_blank"
rel="external nofollow noopener noreferrer"
href="<%- url_for(item.more.url) %>"
title="<%- item.more.url %>">

@ -1,28 +0,0 @@
<% if(theme.widgets.author.enable != false) { %>
<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") %>'/>
</div>
<%} %>
<% if (theme.widgets.author.title == true || theme.widgets.author.motto == true){ %>
<div class='content'>
<% if (theme.widgets.author.title == true){ %>
<h2><%= config.title %></h2>
<% } %>
<% if (theme.widgets.author.motto){ %>
<p><%= config.motto %></p>
<% } %>
</div>
<% } %>
<% if (theme.widgets.author.social == true && config.social){ %>
<div class="social-wrapper">
<% (config.social||[]).forEach(function(value){ %>
<% if (value.url && value.icon) { %>
<a href="<%= url_for(value.url) %>" class="social flat-btn" target="_blank" rel="external"><i class="social <%= value.icon %>" aria-hidden="true"></i></a>
<%}%>
<%})%>
</div>
<% } %>
</section>
<% } %>

@ -1,14 +0,0 @@
<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>
<div class='content <%= theme.style %>'>
<% if (site.categories.length){ %>
<ul class="entry">
<% site.categories.sort('name').each(function(item){ %>
<li><a class="flat-box" href="<%= url_for(item.path) %>"><div class='name'><%= item.name %></div><div class='badge'>(共<%= item.posts.length %>篇)</div></a></li>
<% }); %>
</ul>
<% } %>
</div>
</section>

@ -1,24 +0,0 @@
<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) { %>
<a class="rightBtn" title="联系博主添加友链" target="_blank" rel="external nofollow noopener noreferrer" href="mailto:<%= theme.widgets.links.mailto %>?subject=交换友链&body=你好,我想和你交换友链,我已经将【<%= config.title %>】添加到我的博客的友链中。我的博客链接是:"><i class="fas fa-plus fa-fw"></i></a>
<%} %>
</header>
<div class='content <%= theme.style %>'>
<ul class="entry" id="links">
<% (config.links||[]).forEach(function(item){ %>
<li><a class="flat-box" title="<%= url_for(item.url) %>" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">
<div class='name'>
<% if(item.avatar) { %>
<img src="<%= item.avatar %>">
<% } else { %>
<i class="fas fa-user-circle fa-fw" aria-hidden="true"></i>
<% } %>
&nbsp;&nbsp;<%= item.name %>
</div>
</a></li>
<% }) %>
</ul>
</div>
</section>

@ -1,59 +0,0 @@
<%
var needDisplay = false;
if (theme.widgets.music && theme.widgets.music.display) {
let display = theme.widgets.music.display;
if (page.layout == 'page') {
if (display.page != false) {
needDisplay = true;
}
} else if (page.layout == 'post') {
if (display.post != false && (!page.music || page.music.enable == false)) {
needDisplay = true;
}
} else if (page.layout == 'links') {
if (display.links != false) {
needDisplay = true;
}
} else {
if (is_home()) {
if (display.home != false) {
needDisplay = true;
}
} else if (is_tag()) {
if (display.tag != false) {
needDisplay = true;
}
} else if (is_category()) {
if (display.category != false) {
needDisplay = true;
}
} else if (is_archive()) {
if (display.archive != false) {
needDisplay = true;
}
} else {
needDisplay = true;
}
}
}
%>
<% if (needDisplay == true) { %>
<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="<%= url_for(theme.widgets.music.link) %>"><i class="far fa-heart fa-fw"></i></a>
</header>
<div class='content <%= theme.style %>'>
<div class="aplayer" data-theme="<%= theme.widgets.music.color %>"
data-mode="<%= theme.widgets.music.mode %>"
data-server="<%= theme.widgets.music.server %>"
data-type="<%= theme.widgets.music.type %>"
data-id="<%= theme.widgets.music.id %>"
data-volume="<%= theme.widgets.music.volume %>"></div>
</div>
</section>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script>
<% } %>

@ -1,16 +0,0 @@
<% if (site.tags.length){ %>
<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>
<div class='content <%= theme.style %>'>
<%- tagcloud(site.tags, {
min_font: 14,
max_font: 24,
color: true,
start_color: '#999',
end_color: '#555',
}) %>
</div>
</section>
<% } %>

@ -1,11 +0,0 @@
<% if(page.layout == 'post' && page.content && page.toc!==false && toc(page.content).length > 0){ %>
<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>
</header>
<div class='content <%= theme.style %>'>
<%- toc(page.content, {list_number: false}) %>
</div>
</section>
<% } %>

@ -40,12 +40,12 @@ if (theme.widgets.music && theme.widgets.music.display) {
<% if (needDisplay == true) { %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
<div class="aplayer" data-theme="<%= theme.widgets.music.color %>"
data-mode="<%= theme.widgets.music.mode %>"
data-server="<%= theme.widgets.music.server %>"
data-type="<%= theme.widgets.music.type %>"
data-id="<%= theme.widgets.music.id %>"
data-volume="<%= theme.widgets.music.volume %>">
<div class="aplayer" data-theme="<%= item.color %>"
data-mode="<%= item.mode %>"
data-server="<%= item.server %>"
data-type="<%= item.type %>"
data-id="<%= item.id %>"
data-volume="<%= item.volume %>">
</div>
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script>

Loading…
Cancel
Save