增加config.theme_cdn开关

i18n 1.0-beta13
xaoxuu 6 years ago
parent c1c05648f5
commit d578dc59d3
  1. 2
      _config.yml
  2. 31
      layout/_partial/article.ejs
  3. 8
      layout/_partial/head.ejs
  4. 6
      layout/_partial/scripts.ejs
  5. 1
      source/less/_header.less

@ -8,7 +8,7 @@ info:
name: Material X
docs: https://xaoxuu.com/wiki/material-x/
# 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.40/
cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.41/
############################### 主题样式 ###############################

@ -1,23 +1,26 @@
<article id="<%= post.layout %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta',{post:post}) %>
<section class="article typo">
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<% if(post.layout == 'post'){ %>
<section class='meta' id="footer-meta">
<time class="metatag time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>"><i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i>&nbsp;本文最后更新于:<%- date(post.updated, config.date_format) %></time>
<% if (post.tags && post.tags.length && post.tags.each) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="metatag tags"><a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>&nbsp;' + item.name + '</a></div>');
});
%>
<%- items.join(' ') %>
<% } %>
<time class="metatag time" itemprop="dateUpdated" datetime="<%- moment(post.updated).format() %>" content="<%- date(post.updated, config.date_format) %>"><i class="fas fa-pencil-alt fa-fw" aria-hidden="true"></i>
&nbsp;本文最后更新于:<%- date(post.updated, config.date_format) %>
</time>
<% if (post.tags && post.tags.length) { %>
<%
var items = [];
post.tags.each(function(item){
items.push('<div class="metatag tags"><a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-hashtag fa-fw" aria-hidden="true"></i>&nbsp;' + item.name + '</a></div>');
});
%>
<%- items.join(' ') %>
<% } %>
<% if (theme.services && theme.services.share == true && config.mob && config.mob.app_key && config.mob.list && page.share != false) { %>
<%- partial('../_third-party/share') %>
<% } %>
</section>
<% } %>

@ -59,8 +59,12 @@
<% }) %>
<% } %>
<% if (theme.services && theme.services.cdn == true) { %>
<%- css(theme.info.cdn + 'css/style.css') %>
<% if (theme.services && theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_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') %>
<% } %>

@ -243,8 +243,12 @@
<% } %>
<% } %>
<% } %>
<% if (theme.services.cdn == true) { %>
<% if (theme.services.cdn == true && config.theme_cdn) { %>
<% if (config.theme_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']) %>
<% } %>

@ -326,6 +326,7 @@
color: @black;
padding: 2px 20px;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
&:hover,&.active{
border-left: 4px solid @theme_main;
background: fade(@theme_main, 10%);

Loading…
Cancel
Save