i18n
xaoxuu 6 years ago
parent 9a55441c79
commit 145102700c
  1. 2
      _config.yml
  2. 56
      layout/_partial/head.ejs
  3. 10
      layout/_partial/scripts.ejs
  4. 6
      source/less/_fonts.less

@ -155,4 +155,4 @@ less:
compress: true
# 主题的CDN地址
themecdn: //cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.24/
themecdn: //cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.26/

@ -17,55 +17,73 @@
%>
<title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>
<% if (page.keywords && config.keywords){ %>
<meta name="keywords" content="<%= page.keywords %>, <%= config.keywords %>">
<meta name="keywords" content="<%- page.keywords %>, <%- config.keywords %>">
<% } else if (page.keywords) { %>
<meta name="keywords" content="<%= page.keywords %>">
<meta name="keywords" content="<%- page.keywords %>">
<% } else if (config.keywords) { %>
<meta name="keywords" content="<%= config.keywords %>">
<meta name="keywords" content="<%- config.keywords %>">
<% } %>
<% if (page.description && config.description){ %>
<meta name="description" content="<%- page.description %>, <%- config.description %>">
<% } else if (page.description) { %>
<meta name="description" content="<%- page.description %>">
<% } else if (config.description) { %>
<meta name="description" content="<%- config.description %>">
<% } %>
<%- feed_tag(config.feed.path, {title: config.title}) %>
<meta name="HandheldFriendly" content="True" />
<meta name="apple-mobile-web-app-capable" content="yes">
<%- favicon_tag(config.favicon) %>
<%- feed_tag(config.feed.path, {title: config.title}) %>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="<%= config.shortcut_icon %>" />
<link rel="icon" href="<%= config.favicon %>" />
<!-- link -->
<% if (config.import && config.import.link){ %>
<% (config.import.link||[]).forEach(function(item){ %>
<link rel="<%= item.rel %>" <% if (item.type){ %>type="<%= item.type %>"<% } %> <% if (item.sizes){ %>sizes="<%= item.sizes %>"<% } %> href="<%- item.href %>" <% if (item.color){ %>color="<%= item.color %>"<% } %>>
<% }) %>
<% } %>
<link href='//cdn.jsdelivr.net/npm/node-waves@0.7.5/dist/waves.min.css' rel='stylesheet'>
<!-- meta -->
<% if (config.import && config.import.meta){ %>
<% (config.import.meta||[]).forEach(function(item){ %>
<meta name="<%= item.name %>" href="<%- item.content %>">
<% }) %>
<% } %>
<!-- style.css -->
<% if (config.import && config.import.style == true) { %>
<%- css(theme.themecdn + 'css/style.min.css') %>
<%- css(theme.themecdn + 'css/style.css') %>
<% } else if (config.import && config.import.style && config.import.style.length > 0){ %>
<%- css(config.import.style) %>
<%- css(config.import.style) %>
<% } else { %>
<%- css('style.css') %>
<%- css('style.css') %>
<% } %>
<!-- fontawesome -->
<% if (config.import && config.import.fontawesome == true) { %>
<%- css('//cdn.jsdelivr.net/gh/xaoxuu/cdn-fontawesome@5.6.3/css/all.min.css') %>
<%- css('//cdn.jsdelivr.net/gh/xaoxuu/cdn-fontawesome@5.6.3/css/all.min.css') %>
<% } else if (config.import && config.import.fontawesome && config.import.fontawesome.length > 0){ %>
<%- css(config.import.fontawesome) %>
<%- css(config.import.fontawesome) %>
<% } else { %>
<%- css('fontawesome-free-5.6.3-web/css/all.min.css') %>
<%- css('fontawesome-free-5.6.3-web/css/all.min.css') %>
<% } %>
<!-- google_fonts -->
<% if (config.import && config.import.google_fonts && config.import.google_fonts.length > 0){ %>
<link href="<%= config.import.google_fonts %>" rel="stylesheet">
<!-- google_fonts -->
<link href="<%= config.import.google_fonts %>" rel="stylesheet">
<% } %>
<link href='//cdn.jsdelivr.net/npm/node-waves@0.7.5/dist/waves.min.css' rel='stylesheet'>
<script>
function setLoadingBarProgress(num) {
document.getElementById('loading-bar').style.width=num+"%";
}
</script>
<!-- ga -->
<% if (config.google_analytics) { %>
<!-- ga -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@ -75,8 +93,8 @@
ga('send', 'pageview');
</script>
<% } %>
<!-- ba -->
<% if (config.baidu_analytics_key) { %>
<!-- ba -->
<script>
var _hmt = _hmt || [];
(function() {

@ -30,15 +30,11 @@
<% if (config.import && config.import.js == true) { %>
<%- js(theme.themecdn + 'js/app.js') %>
<%- js(theme.themecdn + 'js/search.js') %>
<%- js([theme.themecdn + 'js/app.js', theme.themecdn + 'js/search.js']) %>
<% } else if (config.import && config.import.js && config.import.js.length > 0) { %>
<% (config.usecdn||[]).forEach(function(cdn_url){ %>
<%- js(cdn_url) %>
<% }) %>
<%- js(config.import.js) %>
<% } else { %>
<%- js('js/app.js') %>
<%- js('js/search.js') %>
<%- js(['js/app.js', 'js/search.js']) %>
<% } %>

@ -1,18 +1,18 @@
@font-face{
font-family: 'Ubuntu';
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.24/Ubuntu/Ubuntu-Regular.ttf);
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.25/Ubuntu/Ubuntu-Regular.ttf);
font-weight: normal;
font-style: normal;
}
@font-face{
font-family: 'Monaco';
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.24/Monaco/Monaco.ttf);
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.25/Monaco/Monaco.ttf);
font-weight: normal;
font-style: normal;
}
@font-face{
font-family: 'Skranji';
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.24/Skranji/Skranji-Regular.ttf);
src: url(https://cdn.jsdelivr.net/gh/xaoxuu/cdn-fonts@18.12.25/Skranji/Skranji-Regular.ttf);
font-weight: normal;
font-style: normal;
}

Loading…
Cancel
Save