i18n
xaoxuu 4 years ago
parent 079c696d8d
commit 13e4ccc009
  1. 117
      _config.yml
  2. 4
      layout/_meta/author.ejs
  3. 2
      layout/_meta/category.ejs
  4. 2
      layout/_meta/counter.ejs
  5. 4
      layout/_meta/date.ejs
  6. 5
      layout/_meta/music.ejs
  7. 2
      layout/_meta/share.ejs
  8. 2
      layout/_meta/tags.ejs
  9. 4
      layout/_meta/title.ejs
  10. 2
      layout/_meta/top.ejs
  11. 4
      layout/_meta/updated.ejs
  12. 4
      layout/_meta/wordcount.ejs
  13. 4
      layout/_partial/footer.ejs
  14. 4
      layout/_partial/head.ejs
  15. 5
      layout/_partial/meta.ejs
  16. 5
      layout/_partial/scripts.ejs
  17. 47
      layout/_third-party/aplayer.ejs
  18. 2
      layout/_third-party/share.ejs
  19. 17
      layout/_widget/music.ejs
  20. 6
      layout/links.ejs

@ -21,32 +21,15 @@ style: pure # pure: 导航栏和标题栏背景是白色
scrollreveal: true # 页面滚动显示动画
nodewaves: true # 按钮点击效果
busuanzi: true # 访问量统计
aplayer: true # 启用音乐播放器
# fastclick: true
# commentTyping: true # 文本框打字机特效
# wordcount: true # 文章字数统计、阅读时长,开启需要安装插件: npm i --save hexo-wordcount
commentTyping: true # 文本框打字机特效
# wordcount: true # 文章字数统计、阅读时长,开启需要安装插件: npm i --save hexo-wordcount
############################### 默认值 ###############################
# 音乐控件的默认配置,如果sidebar或者page里没有提供,就取这里的参数
music:
enable: true # 是否启用
color: '#1BCDFC' # 主题色
mode: circulation # random (随机) single (单曲) circulation (列表循环) order (列表)
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
type: playlist # song (单曲) album (专辑) playlist (歌单) search (搜索)
id: 3175833810 # 歌曲/专辑/歌单 ID
volume: 0.7 # 音量, 0~1
autoplay: false # 自动播放
# 友链页头像占位图
avatar_placeholder: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avatar.png
# 日期格式 http://momentjs.com/docs/
date_format: 'YYYY-MM-DD' # 文章发布日期的格式
updated_date_format: 'll' # 文章更新日期的格式
# 幻灯片
############################### 自定义 ###############################
# 幻灯片背景
backstretch:
position: background # cover: 封面背景 background: 整个网页背景
duration: 6000 # 持续时间(毫秒)
@ -58,8 +41,6 @@ backstretch:
- https://i.loli.net/2020/02/08/RP7JpGvWaCYfuB6.jpg
############################### 自定义 ###############################
# page的封面
cover:
scheme: search # 后期将会提供多种封面布局方案
@ -154,9 +135,60 @@ layout:
# 文章页脚,自动在每一篇文章末尾添加
footer: [copyright, donate]
# 文章页面的侧边栏
sidebar: [blogger, toc, category, tagcloud, donate]
sidebar: [blogger, toc, category, tagcloud, music, donate]
# 其他的页面布局暂时等于文章列表
# meta库配置
meta:
# 文章标题
title: # 暂无配置
# 文章作者
author:
icon: fas fa-user # 如果配置了头像,则不会显示图标
# 文章创建日期
date:
icon: fas fa-calendar-alt
format: 'YYYY-MM-DD' # 日期格式 http://momentjs.com/docs/
# 文章更新日期
updated:
icon: fas fa-clock
format: 'll' # 日期格式 http://momentjs.com/docs/
# 文章分类
category:
icon: fas fa-folder-open
# 文章置顶
top:
icon: fas fa-angle-double-up
# 文章浏览计数
counter:
icon: fas fa-eye
# 文章字数和阅读时长
wordcount:
icon_wordcount: fas fa-keyboard
icon_duration: fas fa-hourglass-half
# 文章标签
tags:
icon: fas fa-tag
# 分享
share:
- id: qq
name: QQ好友
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png
- id: qzone
name: QQ空间
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: 微信
# img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/wechat.png
- id: weibo
name: 微博
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: QRcode
# img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qrcode.png
# 组件库配置
widget:
# ---------------------------------------
@ -216,14 +248,19 @@ widget:
class: music
icon: fas fa-compact-disc
title: "最近在听"
theme: '#1BCDFC' # 主题色
autoplay: true # 自动播放
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
order: list # list (列表) 'random'(随机)
loop: all # 'all', 'one', 'none'
type: playlist # song (单曲) album (专辑) playlist (歌单) search (搜索)artist
mid: 3175833810 # 歌曲/专辑/歌单 ID/搜索关键词
volume: 0.7 # 音量, 0~1
more: # 右上角的按钮
icon: far fa-heart
url: https://music.163.com/#/user/home?id=63035382
rel: external nofollow noopener noreferrer
target: _blank
server: netease # netease(网易云音乐)tencent(QQ音乐) xiami(虾米) kugou(酷狗)
type: playlist # song (单曲) album (专辑) playlist (歌单) search (搜索)
mid: 3175833810 # 歌曲/专辑/歌单 ID
# ---------------------------------------
# 版权说明小部件(仅用于文章中)
- id: copyright
@ -315,7 +352,6 @@ widget:
target: _blank
# 社交信息配置
social:
- icon: fas fa-rss
@ -328,27 +364,12 @@ social:
url: https://music.163.com/#/user/home?id=63035382
# 分享按钮
share:
- id: qq
name: QQ好友
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qq.png
- id: qzone
name: QQ空间
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qzone.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: 微信
# img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/wechat.png
- id: weibo
name: 微博
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/weibo.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: QRcode
# img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qrcode.png
############################### 需要复制到根目录配置文件中 ###############################
# 请复制到根目录配置文件!
# copyright: '[Copyright © 2017-2020 Mr. X](https://xaoxuu.com)'
# 网页最底部的文字,支持md
copyright: '[Copyright © 2017-2020 Mr. X](https://xaoxuu.com)'
############################### 评论系统 ###############################
# disqus_shortname: 要使用哪个请复制到根目录配置文件!

@ -5,7 +5,7 @@
<% if (post.author.avatar) { %>
<img src="<%- post.author.avatar %>">
<% } else { %>
<i class="fas fa-user" aria-hidden="true"></i>
<i class="<%- theme.meta.author.icon %>" aria-hidden="true"></i>
<% } %>
<p><%- post.author.name %></p>
</a>
@ -14,7 +14,7 @@
<% if (config.avatar) { %>
<img src="<%- config.avatar %>">
<% } else { %>
<i class="fas fa-user" aria-hidden="true"></i>
<i class="<%- theme.meta.author.icon %>" aria-hidden="true"></i>
<% } %>
<p><%- config.author %></p>
</a>

@ -9,7 +9,7 @@
%>
<div class='new-meta-item category'>
<a href='<%- url_for(path) %>' rel="nofollow">
<i class="fas fa-folder-open" aria-hidden="true"></i>
<i class="<%- theme.meta.category.icon %>" aria-hidden="true"></i>
<p><%- cats.join('&nbsp;/&nbsp;') %></p>
</a>
</div>

@ -2,7 +2,7 @@
<% if (theme.busuanzi == true) { %>
<div class="new-meta-item browse busuanzi">
<a class='notlink'>
<i class="fas fa-eye" aria-hidden="true"></i>
<i class="<%- theme.meta.counter.icon %>" aria-hidden="true"></i>
<p>
<span id="busuanzi_value_page_pv">
<i class="fas fa-spinner fa-spin fa-fw" aria-hidden="true"></i>

@ -1,6 +1,6 @@
<div class="new-meta-item date">
<a class='notlink'>
<i class="fas fa-calendar-alt" aria-hidden="true"></i>
<p><%- date(post.date, theme.date_format) %></p>
<i class="<%- theme.meta.date.icon %>" aria-hidden="true"></i>
<p><%- date(post.date, theme.meta.date.format) %></p>
</a>
</div>

@ -1,6 +1,3 @@
<% if(post.music && post.music.enable != false){ %>
<%- partial('../_third-party/aplayer',
{aplayer_theme: '', aplayer_mini: true, aplayer_mode: 'circulation',
aplayer_server: post.music.server, aplayer_type: post.music.type, aplayer_id: post.music.id,
aplayer_volume: post.music.volume?post.music.volume:'0.7', aplayer_autoplay: post.music.autoplay?true:false }) %>
<%- partial('../_third-party/aplayer', {post: post}) %>
<% } %>

@ -1,3 +1,3 @@
<% if (theme.share) { %>
<% if (theme.meta.share) { %>
<%- partial('../_third-party/share') %>
<% } %>

@ -2,7 +2,7 @@
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="new-meta-item meta-tags"><a class="tag" href="'+url_for(item.path)+'" rel="nofollow"><i class="fas fa-tag" aria-hidden="true"></i><p>' + item.name + '</p></a></div>');
items.push('<div class="new-meta-item meta-tags"><a class="tag" href="'+url_for(item.path)+'" rel="nofollow"><i class="' + theme.meta.tags.icon + '" aria-hidden="true"></i><p>' + item.name + '</p></a></div>');
});
%>
<%- items.join(' ') %>

@ -1,14 +1,14 @@
<% if(isPostList){ %>
<h2 class="title">
<a href="<%- url_for(post.link || post.path) %>">
<%- post.title ? post.title : date(post.date, theme.date_format) %>
<%- post.title ? post.title : date(post.date, theme.meta.date.format) %>
</a>
</h2>
<% } else { %>
<% if (post.title || page.title || config.title) { %>
<h1 class="title">
<a href="<%- url_for(post.link || post.path) %>">
<%- post.title ? post.title : date(post.date, theme.date_format) %>
<%- post.title ? post.title : date(post.date, theme.meta.date.format) %>
</a>
</h1>
<% } %>

@ -1,7 +1,7 @@
<% if(isPostList && post.top){ %>
<div class="new-meta-item top-post">
<a class='notlink'>
<i class="fas fa-angle-double-up" aria-hidden="true"></i>
<i class="<%- theme.meta.top.icon %>" aria-hidden="true"></i>
<p><%- post.top != true ? post.top : __('post.top') %></p>
</a>
</div>

@ -1,6 +1,6 @@
<div class="new-meta-item date" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>">
<a class='notlink'>
<i class="fas fa-clock" aria-hidden="true"></i>
<p><%- __('post.updated') + ' ' + date(post.updated, theme.updated_date_format) %></p>
<i class="<%- theme.meta.updated.icon %>" aria-hidden="true"></i>
<p><%- __('post.updated') + ' ' + date(post.updated, theme.meta.updated.format) %></p>
</a>
</div>

@ -1,13 +1,13 @@
<% if (theme.wordcount) { %>
<div class="new-meta-item wordcount">
<a class='notlink'>
<i class="fas fa-keyboard" aria-hidden="true"></i>
<i class="<%- theme.meta.wordcount.icon_wordcount %>" aria-hidden="true"></i>
<p><%- __('post.wordcount', wordcount(post.content))%></p>
</a>
</div>
<div class="new-meta-item readtime">
<a class='notlink'>
<i class="fas fa-hourglass-half" aria-hidden="true"></i>
<i class="<%- theme.meta.wordcount.icon_duration %>" aria-hidden="true"></i>
<p><%- __('post.duration', min2read(post.content))%></p>
</a>
</div>

@ -26,9 +26,9 @@
<% } %>
<%- __('symbol.period') %>
</div>
<% if (theme.copyright) { %>
<% if (config.copyright) { %>
<div class='copyright'>
<%- markdown(theme.copyright) %>
<%- markdown(config.copyright) %>
</div>
<%}%>
</footer>

@ -59,6 +59,10 @@
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<% } %>
<% if (theme.aplayer == true) { %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.css">
<% } %>
<% if (config.use_cdn && theme.info && theme.info.cdn && theme.info.cdn.css && theme.info.cdn.css.style) { %>
<%- css(theme.info.cdn.css.style) %>
<% } else { %>

@ -34,10 +34,7 @@ if (post.meta && (post.meta.footer !== undefined && post.meta.footer !== null))
<% if (position == 'header') { %>
<section class='meta'>
<% if (post.music && post.music.enable != false) { %>
<%- partial('../_third-party/aplayer',
{aplayer_theme: '', aplayer_mini: true, aplayer_mode: 'circulation',
aplayer_server: post.music.server, aplayer_type: post.music.type, aplayer_id: post.music.id,
aplayer_volume: post.music.volume?post.music.volume:'0.7', aplayer_autoplay: post.music.autoplay?true:false }) %>
<%- partial('../_third-party/aplayer', {post: post}) %>
<% } %>
<% if(post.thumbnail && post.thumbnail.length){ %>
<a title='<%- post.title %>' href='<%- url_for(post.link || post.path) %>'><img class='thumbnail' src='<%- post.thumbnail %>'></a>

@ -21,7 +21,10 @@
</script>
<% } %>
<script src="//instant.page/1.2.2" type="module" integrity="sha384-2xV8M5griQmzyiY3CDqh1dn4z3llDVqZDqzjzcY+jCBCk/a5fXJmuZ/40JJAPeoU"></script>
<% if (theme.aplayer == true) { %>
<script async src="https://cdn.jsdelivr.net/npm/aplayer@1.10/dist/APlayer.min.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/meting@2.0/dist/Meting.min.js"></script>
<% } %>
<% if (theme.scrollreveal == true) { %>
<script src="https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js"></script>
<script type="text/javascript">

@ -1,15 +1,34 @@
<% if (theme.music && theme.music.enable == true) { %>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css">
<div class="aplayer"
data-theme="<%- aplayer_theme != undefined ? aplayer_theme : theme.music.color %>"
<%if(aplayer_mini){%>data-mini=true <%}%>
<%if(aplayer_autoplay != undefined ? aplayer_autoplay : theme.music.autoplay){%>data-autoplay=true <%}%>
data-mode="<%- aplayer_mode != undefined ? aplayer_mode : theme.music.mode %>"
data-server="<%= aplayer_server != undefined ? aplayer_server : theme.music.server %>"
data-type="<%= aplayer_type != undefined ? aplayer_type : theme.music.type %>"
data-id="<%= aplayer_id != undefined ? aplayer_id : theme.music.id %>"
data-volume="<%= aplayer_volume != undefined ? aplayer_volume : theme.music.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>
<%
let music;
if (music == undefined) {
theme.widget.forEach(function(widget){
if (widget.class == 'music'){
music = widget;
}
})
}
%>
<% if (theme.aplayer == true) { %>
<% if (post && post.music) { %>
<meting-js
mini='true'
autoplay='<%- (post.music && post.music.autoplay) || music.autoplay %>'
volume='<%- music.volume %>'
loop='<%- music.loop %>'
server='<%- (post.music && post.music.server) || music.server %>'
type='<%- post.music && post.music.type || music.type %>'
id='<%- post.music && post.music.id || music.mid %>'>
</meting-js>
<% } else { %>
<meting-js
theme='<%- music.theme %>'
autoplay='<%- music.autoplay %>'
volume='<%- music.volume %>'
loop='<%- music.loop %>'
order='<%- music.order %>'
server='<%- music.server %>'
type='<%- music.type %>'
id='<%- music.mid %>'>
</meting-js>
<% } %>
<% } %>

@ -1,6 +1,6 @@
<div class="new-meta-item share -mob-share-list">
<div class="-mob-share-list share-body">
<% (theme.share||[]).forEach(function(item){ %>
<% (theme.meta.share||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode'){ %>
<a class='qrcode' rel="external nofollow noopener noreferrer" href='<%- qrcode(url) %>'>
<% if (item.img){ %>

@ -1,21 +1,8 @@
<%
var needDisplay = true;
if (page.music && page.music.autoplay) {
needDisplay = false;
}
if (page.widget && page.widget.music == false) {
needDisplay = false;
}
%>
<% if (theme.music && theme.music.enable == true && needDisplay == true) { %>
<% if (theme.aplayer == true) { %>
<section class='widget <%- item.class %>'>
<%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'>
<%- partial('../_third-party/aplayer',
{aplayer_theme: item.color, aplayer_mini: false, aplayer_mode: item.mode,
aplayer_server: item.server, aplayer_type: item.type, aplayer_id: item.mid,
aplayer_volume: item.volume, aplayer_autoplay: item.autoplay?item.autoplay:false }) %>
<%- partial('../_third-party/aplayer', {post: null}) %>
</div>
</section>
<% } %>

@ -20,7 +20,11 @@
<a class='friend-card' style='background:<%- item.backgroundColor %>; color:<%- item.textColor %>'
target="_blank" rel="external nofollow noopener noreferrer" href='<%- url_for(item.url || '') %>'>
<div class='friend-left'>
<img class='avatar' src='<%- theme.avatar_placeholder %>' data-echo='<%- url_for(item.avatar ? item.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/>
<img class='avatar'
<% if(page.avatar_placeholder){ %>
src='<%- page.avatar_placeholder %>'
<% } %>
data-echo='<%- url_for(item.avatar ? item.avatar : "https://img.vim-cn.com/a4/87a96e2e01b1180bba1e76e190df5220378c1a.png") %>'/>
</div>
<div class='friend-right'>
<p class="friend-name"><%- item.name %></p>

Loading…
Cancel
Save