Bladeren bron

v2

can change the cdn
Sr WoOoW 10 jaren geleden
bovenliggende
commit
9b060f1e81

+ 3 - 0
_config.yml.example

@@ -40,6 +40,9 @@ contacts:
 links:
   Hexo: http://hexo.io
 
+# CDN
+cdn: useso #If your site loads slowly change it to "google" , because "useso" is slow out of China
+
 # Miscellaneous
 google_site_verification:
 google_analytics:

+ 1 - 1
layout/_partial/after-footer.ejs

@@ -24,7 +24,7 @@
 </script>
 <% } %>
 
-<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+<%- partial('cdn_after_footer') %>
 
 <% if (theme.fancybox){ %>
   <%- css('fancybox/jquery.fancybox') %>

+ 5 - 0
layout/_partial/cdn_after_footer.ejs

@@ -0,0 +1,5 @@
+<% if (theme.cdn == "google"){ %>
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+<% } else if (theme.cdn == "useso"){ %>
+ <script src="//ajax.useso.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
+<% } %>

+ 7 - 0
layout/_partial/cdn_head.ejs

@@ -0,0 +1,7 @@
+<% if (theme.cdn == "google"){ %>
+ <link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600' rel='stylesheet' type='text/css'>
+ <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
+<% } else if (theme.cdn == "useso"){ %>
+ <link href='//fonts.useso.com/css?family=Open+Sans:400italic,400,600' rel='stylesheet' type='text/css'>
+ <link href="//fonts.useso.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
+<% } %>

+ 0 - 1
layout/_partial/google_site_verification.ejs

@@ -1,4 +1,3 @@
 <% if (theme.google_site_verification){ %>
 <meta name="google-site-verification" content="<%= theme.google_site_verification %>" />
-<!-- By SrWoOoW -->
 <% } %>

+ 2 - 2
layout/_partial/head.ejs

@@ -28,11 +28,11 @@
   <% if (theme.favicon){ %>
     <link rel="icon" href="<%- theme.favicon %>">
   <% } %>
-  <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
-  <link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600' rel='stylesheet' type='text/css'>
+  <%- partial('cdn_head') %>
   <%- css('css/style') %>
   <%- css('font-awesome/css/font-awesome.min') %>
   <%- partial('google-analytics') %>
+  <%- partial('google_site_verification') %>
   <% if( theme.customstylesheet ){ %>
     <%- css('css/'+theme.customstylesheet) %>
   <% } %>