Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(head): minor changes of dns-prefetch #396

Merged
merged 1 commit into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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