i18n 1.2.1
xaoxuu 5 years ago
parent 917ae3cb06
commit b7d063cceb
  1. 29
      _config.yml
  2. 6
      layout/_partial/article.ejs
  3. 25
      layout/_partial/cover.ejs
  4. 33
      layout/_partial/scripts.ejs
  5. 2
      layout/_third-party/comments.ejs
  6. 1
      layout/category.ejs
  7. 24
      layout/layout.ejs
  8. 1
      layout/list.ejs
  9. 1
      layout/tag.ejs
  10. 2
      source/js/app.js
  11. 22
      source/less/_base.less

@ -4,10 +4,10 @@ info:
docs: https://xaoxuu.com/wiki/material-x/
cdn: # 把对应的那一行注释掉就使用本地的文件
css:
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.18/css/style.css
style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.19/css/style.css
js:
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.18/js/app.js
search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.18/js/search.js
app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.19/js/app.js
search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.19/js/search.js
volantis: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js
@ -44,6 +44,16 @@ avatar_placeholder: https://cdn.jsdelivr.net/gh/xaoxuu/assets@master/avatar/avat
date_format: 'YYYY-MM-DD' # 文章发布日期的格式
updated_date_format: 'll' # 文章更新日期的格式
# 幻灯片
# backstretch:
# position: cover # cover: 封面背景 full: 整个网页背景
# duration: 6000 # 持续时间(毫秒)
# fade: 1500 # 渐变(毫秒)
# images:
# - https://img.vim-cn.com/f6/78aed21213230b9220f310f9ea6c822b011846.jpg
# - https://img.vim-cn.com/d5/b004c81a13aea401375d03b1258ecadbfcbaa7.jpg
# - https://img.vim-cn.com/4c/8e7294998989454b2dcd2624373d5a699c4414.jpg
############################### 自定义 ###############################
# page的封面
@ -217,6 +227,19 @@ share:
# footer: '页脚文字,支持[markdown](/)'
############################### 评论系统 ###############################
# disqus_shortname: 要使用哪个请复制到根目录配置文件!
# livere_uid: 要使用哪个请复制到根目录配置文件!
# gitalk: 要使用哪个请复制到根目录配置文件!
# clientID: 你的clientID
# clientSecret: 你的clientSecret
# repo: 你的repo名
# owner: 你的GitHub名
# admin: [] 至少填写你的GitHub名
# leancloud: 要使用哪个请复制到根目录配置文件!
# app_id: 你的appId
# app_key: 你的appKey
############################### 杂项,请勿删除 ###############################
#valine配置

@ -81,6 +81,12 @@
<% } %>
<% }) %>
<%
if (sections.indexOf('comments') < 0) {
page.comments = false;
}
%>
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->
<% if (page.mathjax){ %>
<%- partial('mathjax') %>

@ -1,31 +1,10 @@
<%
var showCover = false;
if (theme.cover) {
// 如果页面的Front-matter声明了cover,就取页面的值
if (page.cover != undefined) {
showCover = page.cover;
} else {
// 否则,如果是首页,只有首页的第一页显示
if (is_home()) {
if (page.prev) {
showCover = false;
} else {
showCover = true;
}
} else {
showCover = true;
}
}
}
%>
<% if (showCover == true) { %>
<div class="cover-wrapper">
<div class='cover <%- page.layout %> <%- is_home() ? theme.cover.height : "half" %>'>
<cover class='cover <%- page.layout %> <%- is_home() ? theme.cover.height : "half" %>'>
<% if (theme.cover.scheme == 'search') { %>
<%- partial('../_cover/search') %>
<% } %>
</div>
</cover>
<%- partial('header', null, {cache: false, path: path}) %>
</div>
<% } else { %>

@ -54,13 +54,44 @@
</script>
<% } %>
<% if (theme.backstretch && (theme.backstretch.images || page.images)) { %>
<% var imgs = theme.backstretch.images || page.images; %>
<% var posi = null;
if (theme.backstretch.position == 'cover') {
posi = '.cover';
}
%>
<% if (imgs != undefined && theme.backstretch.position != undefined){ %>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-backstretch/2.0.4/jquery.backstretch.min.js"></script>
<script type="text/javascript">
$(function(){
if ('<%- posi %>') {
$('<%- posi %>').backstretch(
<%- '["' + imgs.join('", "') + '"]' %>,
{
duration: "<%- theme.backstretch.duration %>",
fade: "<%- theme.backstretch.fade %>"
});
} else {
$.backstretch(
<%- '["' + imgs.join('", "') + '"]' %>,
{
duration: "<%- theme.backstretch.duration %>",
fade: "<%- theme.backstretch.fade %>"
});
}
});
</script>
<% } %>
<% } %>
<%
var enableDisqus = false;
var enableLivere = false;
var enableGitalk = false;
var enableValine = false;
if (page && page.comments != false) {
if (page && page.comments == true) {
if (config.disqus_shortname) {
enableDisqus = true;
}

@ -52,4 +52,6 @@
<% } %>
</section>
</article>
<% } else { %>
<% page.comments = false; %>
<% } %>

@ -1,3 +1,4 @@
<% page.comments = false; %>
<div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
<% if (site.posts && site.posts.length > 0) { %>
<% if (page.layout == 'category') { %>

@ -2,8 +2,28 @@
<html>
<%- partial('_partial/head') %>
<body>
<%- partial('_partial/cover') %>
<div class="l_body">
<%
var showCover = false;
if (theme.cover) {
// 如果页面的Front-matter声明了cover,就取页面的值
if (page.cover != undefined && page.cover != undefined) {
showCover = page.cover;
} else {
// 否则,如果是首页,只有首页的第一页显示
if (is_home()) {
if (page.prev) {
showCover = false;
} else {
showCover = true;
}
} else {
showCover = true;
}
}
}
%>
<%- partial('_partial/cover', {showCover: showCover}) %>
<div class="l_body<%- showCover ? '' : ' nocover' %>">
<div class='body-wrapper'>
<%- body %>
<script>setLoadingBarProgress(60);</script>

@ -1,3 +1,4 @@
<% page.comments = false; %>
<div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
<% if (site.posts && site.posts.length > 0) { %>
<section class="post-list">

@ -1,3 +1,4 @@
<% page.comments = false; %>
<div class='l_main'>
<% if (site.posts && site.posts.length > 0) { %>
<% if (page.layout == 'tag') { %>

@ -36,7 +36,7 @@ var customSearch;
const $coverAnchor = $('.cover-wrapper');
var showHeaderPoint = 0;
if ($coverAnchor[0]) {
showHeaderPoint = $coverAnchor[0].clientHeight - 64;
showHeaderPoint = $coverAnchor[0].clientHeight - 164;
}
var pos = document.body.scrollTop;
$(document, window).scroll(() => {

@ -46,17 +46,19 @@ fancybox{
display: flex;
justify-content: center;
}
.backstretch {
opacity: .75;
}
.cover-wrapper{
padding-bottom: 2px;
.cover{
top: 0;
left: 0;
max-width: 100%;
height: ~"calc(100vh - @{gap} - @{height_navbar})";
height: ~"calc(100vh)";
display: flex;
flex-wrap: nowrap;
flex-direction: column;
margin-bottom: 2*@gap;
align-items: center;
align-self: center;
align-content: center;
@ -147,10 +149,15 @@ fancybox{
&.half{
height: ~"calc(60vh - @{gap} - @{height_navbar})";
.title, .logo{
margin-top: ~"calc(20vh - 2*@{gap})";
margin-top: ~"calc(20vh - 4*@{gap})";
}
@media(max-width: @on_phone){
.title, .logo{
margin-top: ~"calc(32vh - 6*@{gap})";
}
}
.m_search{
margin-top: 2vh;
margin-top: 1vh;
}
}
&, a{
@ -483,7 +490,10 @@ ul.h-list {
.l_body {
position: relative;
margin: @gap;
margin-top: @height_navbar + @gap;
margin-top: @gap;
&.nocover{
margin-top: @gap + @height_navbar;
}
@media(max-width: @on_phone) {
margin: @height_navbar + @gap 0 @gap;
border-radius: 0;

Loading…
Cancel
Save