Przeglądaj źródła

修复CDN BUG,将Google APIs作为默认CDN & 修改Gravatar的配置位置

ppoffice 10 lat temu
rodzic
commit
77214cca3c

+ 7 - 5
_config.yml.example

@@ -1,5 +1,5 @@
 # Logo
-logo: css/images/logo.png # Empty this to unset logo
+logo: css/images/logo.png # Empty this to unset logo and show site title in the same place
 
 # Header
 menu:
@@ -14,9 +14,8 @@ excerpt_link: Read More
 fancybox: true
 
 # Profile
-profile: true # whether to show profile bar
-gravatar: false # whether to use gravatar with the email
-showlogo: false # whether to show the logo in the header
+profile: true # Whether to show profile bar
+gravatar: false # Whether to use gravatar with the email. If you do, put your email address in your site's `_config.yml`.
 
 # Sidebar
 sidebar: right # set to false if you don't want a sidebar
@@ -41,7 +40,10 @@ links:
   Hexo: http://hexo.io
 
 # CDN
-cdn: useso #If your site loads slowly change it to "google" , because "useso" is slow out of China
+cdn: # You can choose "useso" instead of "google apis"(default).
+# cdn: useso
+# OR
+# cdn:
 
 # Miscellaneous
 google_site_verification:

+ 1 - 0
_config.yml.site.example

@@ -11,6 +11,7 @@ author_title: 'Web Developer & Designer'
 avatar: css/images/avatar.png
 location: 'Harbin, China'
 follow: https://github.com/ppoffice/
+email: # Your email (Used to show Gravatar).
 language: en
 timezone:
 since: 2000 # The start year showing in your copyright section.

+ 3 - 3
layout/_partial/cdn_after_footer.ejs

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

+ 4 - 4
layout/_partial/cdn_head.ejs

@@ -1,7 +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"){ %>
+<% 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">
+<% } else { %>
+ <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'>
 <% } %>

+ 1 - 1
layout/_partial/header.ejs

@@ -10,7 +10,7 @@
       <% if(theme.profile) { %>
         <nav id="sub-nav">
           <div class="profile" id="profile-nav">
-            <a id="profile-anchor" href="javascript:;"><img class="avatar" src="<%= ( theme.gravatar ? gravatar(theme.email) : url_for(config.avatar)) %>"><i class="fa fa-caret-down"></i></a>
+            <a id="profile-anchor" href="javascript:;"><img class="avatar" src="<%= ( theme.gravatar ? gravatar(config.email) : url_for(config.avatar)) %>"><i class="fa fa-caret-down"></i></a>
           </div>
         </nav>
       <% } %>

+ 1 - 1
layout/_partial/profile.ejs

@@ -1,7 +1,7 @@
 <aside id="profile">
   <div class="inner profile-inner">
     <div class="base-info profile-block">
-      <img id="avatar" src="<%= ( theme.gravatar ? gravatar(theme.email) : url_for(config.avatar)) %>">
+      <img id="avatar" src="<%= ( theme.gravatar ? gravatar(config.email) : url_for(config.avatar)) %>">
       <h2 id="name"><%= config.author %></h2>
       <h3 id="title"><%= config.author_title %></h3>
       <span id="location"><i class="fa fa-map-marker"></i><%= config.location %></span>