Skip to content

Commit

Permalink
feat(head): minor changes of dns-prefetch
Browse files Browse the repository at this point in the history
Merge pull request #396 from viosey/feat/head/dns-prefetch
  • Loading branch information
neoFelhz authored Jun 16, 2017
2 parents ff2823c + c6c4d62 commit 328906f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 38 deletions.
44 changes: 44 additions & 0 deletions layout/_partial/config_dnsprefetch.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<meta http-equiv="x-dns-prefetch-control" content="on">
<% if(theme.vendors.materialcdn) { %>
<link rel="dns-prefetch" href="<%= theme.vendors.materialcdn %>"/>
<% } %>
<% if(theme.leancloud.enable === true) { %>
<link rel="dns-prefetch" href="<%= theme.leancloud.av_core_mini %>"/>
<% } %>
<% if(theme.busuanzi.enable === true) { %>
<link rel="dns-prefetch" href="https://busuanzi.ibruce.info"/>
<% } %>
<% if(theme.comment.use == "changyan"){ %>
<link rel="dns-prefetch" href="https://changyan.sohu.com"/>
<% } %>
<% if(theme.comment.use == "163gentie"){ %>
<link rel="dns-prefetch" href="https://img1.cache.netease.com"/>
<% } %>
<% if(theme.comment.use == "livere"){ %>
<link rel="dns-prefetch" href="https://cdn-city.livere.com"/>
<% } %>
<% if(theme.analytics.use === "baidu") { %>
<link rel="dns-prefetch" href="https://hm.baidu.com"/>
<% } %>
<% if(theme.analytics.use === "google") { %>
<link rel="dns-prefetch" href="https://www.google-analytics.com"/>
<% } %>
<% if(theme.analytics.use === "cnzz") { %>
<link rel="dns-prefetch" href="https://s95.cnzz.com"/>
<% } %>
<% if(theme.fonts.host === "google") { %>
<link rel="dns-prefetch" href="https://fonts.googleapis.com"/>
<% } %>
<% if(theme.fonts.host === "baomitu") { %>
<link rel="dns-prefetch" href="https://lib.baomitu.com"/>
<% } %>
<% if(theme.fonts.use === "custom") { %>
<link rel="dns-prefetch" href="<%= theme.fonts.custom_font_host %>"/>
<% } %>
<% if(theme.qrcode.use === "online" && theme.qrcode.enable === "true") { %>
<% if(config.language === "zh-CN") { %>
<link rel="dns-prefetch" href="https://pan.baidu.com"/>
<% } else { %>
<link rel="dns-prefetch" href="https://chart.googleapis.com"/>
<% } %>
<% } %>
39 changes: 1 addition & 38 deletions layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,7 @@
</title>

<!-- dns prefetch -->
<meta http-equiv="x-dns-prefetch-control" content="on">
<% if(theme.materialcdn.use === true) { %>
<link rel="dns-prefetch" href="<%= theme.materialcdn.base %>"/>
<%}%>
<% if(theme.leancloud.enable === true) { %>
<link rel="dns-prefetch" href="<%= theme.leancloud.av_core_mini %>"/>
<% } %>
<% if(theme.comment.use == "changyan"){ %>
<link rel="dns-prefetch" href="https://changyan.sohu.com"/>
<% } %>
<% if(theme.comment.use == "163gentie"){ %>
<link rel="dns-prefetch" href="https://img1.cache.netease.com"/>
<% } %>
<% if(theme.comment.use == "livere"){ %>
<link rel="dns-prefetch" href="https://cdn-city.livere.com"/>
<% } %>
<% if(theme.analytics.use === "baidu") { %>
<link rel="dns-prefetch" href="https://hm.baidu.com"/>
<% } %>
<% if(theme.analytics.use === "google") { %>
<link rel="dns-prefetch" href="https://www.google-analytics.com"/>
<% } %>
<% if(theme.analytics.use === "cnzz") { %>
<link rel="dns-prefetch" href="https://s95.cnzz.com"/>
<% } %>
<% if(theme.busuanzi.enable === true) { %>
<link rel="dns-prefetch" href="https://busuanzi.ibruce.info"/>
<% } %>
<% if(theme.fonts.host === "google") { %>
<link rel="dns-prefetch" href="https://fonts.googleapis.com"/>
<link rel="dns-prefetch" href="https://fonts.gstatic.com"/>
<% } %>
<% if(theme.fonts.host === "baomitu") { %>
<link rel="dns-prefetch" href="https://lib.baomitu.com"/>
<% } %>
<% if(theme.qrcode.use === "online" && theme.qrcode.enable === "true") { %>
<link rel="dns-prefetch" href="https://pan.baidu.com"/>
<% } %>
<%- partial('_partial/config_dnsprefetch') %>

<!-- Meta & Info -->
<meta http-equiv="X-UA-Compatible">
Expand Down

0 comments on commit 328906f

Please sign in to comment.