i18n
xaoxuu 5 years ago
parent 0aa55e8610
commit fd68277d88
  1. 29
      _config.yml
  2. 4
      layout/_partial/footer.ejs
  3. 6
      layout/_partial/head.ejs
  4. 28
      layout/_partial/scripts.ejs
  5. 2
      layout/_third-party/comments.ejs

@ -2,7 +2,6 @@
info:
name: Material X
docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.3.31/
@ -155,6 +154,34 @@ share:
name: QRcode
img: https://cdn.jsdelivr.net/gh/xaoxuu/assets@19.1.9/logo/128/qrcode.png
# footer: 页脚文字,支持markdown
############################### 评论 ###############################
# disqus_shortname: xaoxuu
# livere_uid:
# valine
valine:
enable: true # 如果你想用Valine评论系统,请设置enable为true
# 还需要在根目录配置文件中添加下面这三行内容
# leancloud:
# app_id: 你的appId
# app_key: 你的appKey
guest_info: nick,mail,link #valine comment header info
placeholder: 快来评论吧~ # valine comment input placeholder(like: Please leave your footprints )
avatar: mp # gravatar style https://valine.js.org/avatar
pageSize: 20 # comment list page size
verify: false # valine verify code (true/false)
notify: false # valine mail notify (true/false)
lang: zh-cn
highlight: false
############################### 杂项,请勿删除 ###############################
# 搜索配置
search:

@ -1,7 +1,7 @@
<footer id="footer" class="clearfix">
<% if (config.footer) { %>
<% if (theme.footer) { %>
<div class="footer">
<%- markdown(config.footer) %>
<%- markdown(theme.footer) %>
</div>
<br>
<%}%>

@ -59,12 +59,8 @@
<link rel="shortcut icon" type='image/x-icon' href="<%- url_for(config.favicon) %>">
<% } %>
<% if (theme.services && theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_cdn == true) { %>
<% if (theme.services.cdn == true) { %>
<%- css(theme.info.cdn + 'css/style.css') %>
<% } else if (config.theme_cdn.length > 0) { %>
<%- css(config.theme_cdn + 'css/style.css') %>
<% } %>
<% } else { %>
<%- css('style.css') %>
<% } %>

@ -70,7 +70,7 @@
if (config.livere_uid) {
enableLivere = true;
}
if (config.valine && config.valine.app_id && config.valine.app_key) {
if (theme.valine && theme.valine.enable && config.leancloud) {
enableValine = true;
}
}
@ -115,11 +115,11 @@
<% } %>
<script>
var GUEST_INFO = ['nick','mail','link'];
var guest_info = '<%= config.valine.guest_info %>'.split(',').filter(function(item){
var guest_info = '<%= theme.valine.guest_info %>'.split(',').filter(function(item){
return GUEST_INFO.indexOf(item) > -1
});
var notify = '<%= config.valine.notify %>' == true;
var verify = '<%= config.valine.verify %>' == true;
var notify = '<%= theme.valine.notify %>' == true;
var verify = '<%= theme.valine.verify %>' == true;
var valine = new Valine();
valine.init({
el: '#valine_container',
@ -129,24 +129,20 @@
<% if(page.valine && page.valine.path) { %>
path: "<%= page.valine.path %>",
<% } %>
appId: "<%= config.valine.app_id %>",
appKey: "<%= config.valine.app_key %>",
placeholder: "<%= (page.valine && page.valine.placeholder) ? page.valine.placeholder : config.valine.placeholder %>",
pageSize:'<%= config.valine.pageSize %>',
avatar:'<%= config.valine.avatar %>',
lang:'<%= config.valine.lang %>',
highlight:'<%= config.valine.highlight %>'
appId: "<%= config.leancloud.app_id %>",
appKey: "<%= config.leancloud.app_key %>",
placeholder: "<%= (page.valine && page.valine.placeholder) ? page.valine.placeholder : theme.valine.placeholder %>",
pageSize:'<%= theme.valine.pageSize %>',
avatar:'<%= theme.valine.avatar %>',
lang:'<%= theme.valine.lang %>',
highlight:'<%= theme.valine.highlight %>'
})
</script>
<% } %>
<% if (theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_cdn == true) { %>
<% if (theme.services.cdn == true) { %>
<%- js([theme.info.cdn + 'js/app.js', theme.info.cdn + 'js/search.js']) %>
<% } else if (config.theme_cdn.length > 0) { %>
<%- js([config.theme_cdn + 'js/app.js', config.theme_cdn + 'js/search.js']) %>
<% } %>
<% } else { %>
<%- js(['js/app.js', 'js/search.js']) %>
<% } %>

@ -10,7 +10,7 @@
if (config.livere_uid) {
enableLivere = true;
}
if (config.valine && config.valine.app_id && config.valine.app_key) {
if (theme.valine && theme.valine.enable && config.leancloud) {
enableValine = true;
}
}

Loading…
Cancel
Save