Skip to content

Commit b25d3bf

Browse files
authored
1.2.0 #25
2 parents 5b5ac9d + de20dce commit b25d3bf

22 files changed

+104
-66
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> 现代 · 强大 · 简洁
77
88
<p align="center">
9-
<img alt="Version" src="https://img.shields.io/badge/Version-1.1.1-5755d9.svg?style=flat-square"/>
9+
<img alt="Version" src="https://img.shields.io/badge/Version-1.2.0-5755d9.svg?style=flat-square"/>
1010
<a href="https://suka.moe" target="_blank"><img alt="Author" src="https://img.shields.io/badge/Author-Sukka-b68469.svg?style=flat-square"/></a>
1111
<a href="https://hexo.io" target="_blank"><img alt="Hexo" src="https://img.shields.io/badge/hexo-3.5+-0e83cd.svg?style=flat-square"/></a>
1212
<a href="https://nodejs.org/" target="_blank"><img alt="node.js" src="https://img.shields.io/badge/node.js-8.0%2B-43853d.svg?style=flat-square"/></a>

_config.example.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,15 @@ vendors:
396396
# Personally I prefer the theme here: https://github.com/jmblog/color-themes-for-google-code-prettify
397397
prettify_theme:
398398

399+
fragment_cache: false
399400
# Theme Version
400401
# localStorage cache version
401-
verison: 1.1.1
402+
verison: 1.2.0
402403
old_verison:
403404
- 0.2.0
404405
- 0.0.1
405406
- 0.1.0
406407
- 1.0.0
407408
- 1.0.1
408-
- 1.1.0
409+
- 1.1.0
410+
- 1.1.1

layout/_partial/footer.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
<!-- footer develop info -->
1717
<p class="footer-develop mb-0">
1818
<% if (theme.busuanzi.enable === true) { %>
19-
<%- partial('_plugin/busuanzi/footer_counter', {}, {cache: true}) %>
19+
<%- partial('_plugin/busuanzi/footer_counter', {}, {cache: theme.fragment_cache}) %>
2020
<% } %>
2121
<% if ( (theme.valine_counter.enable === true) && (theme.valine_counter.site_pv.enable === true) ) { %>
22-
<%- partial('_plugin/valine-counter/footer', {}, {cache: true}) %>
22+
<%- partial('_plugin/valine-counter/footer', {}, {cache: theme.fragment_cache}) %>
2323
<% } %>
2424
Powered by&nbsp;<!--
2525
--><a href="https://hexo.io" target="_blank" class="footer-develop-a" rel="nofollow noopener noreferrer">Hexo</a><span class="footer-develop-divider"></span>Theme&nbsp;-&nbsp;<!--

layout/_partial/head/analytics.ejs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<% if (theme.analytics.google_site_id) { %>
2-
<%- partial('_plugin/analytics/google', {}, {cache: true}) %>
2+
<%- partial('_plugin/analytics/google', {}, {cache: theme.fragment_cache}) %>
33
<% } %>
44
<% if (theme.analytics.gtags_site_id) { %>
5-
<%- partial('_plugin/analytics/gtags', {}, {cache: true}) %>
5+
<%- partial('_plugin/analytics/gtags', {}, {cache: theme.fragment_cache}) %>
66
<% } %>
77
<% if (theme.analytics.baidu_site_id) { %>
8-
<%- partial('_plugin/analytics/baidu', {}, {cache: true}) %>
8+
<%- partial('_plugin/analytics/baidu', {}, {cache: theme.fragment_cache}) %>
99
<% } %>
1010
<% if (theme.analytics.cnzz_site_id) { %>
11-
<%- partial('_plugin/analytics/cnzz', {}, {cache: true}) %>
11+
<%- partial('_plugin/analytics/cnzz', {}, {cache: theme.fragment_cache}) %>
1212
<% } %>
1313
<% if (theme.analytics.tencent_site_id) { %>
14-
<%- partial('_plugin/analytics/tencent', {}, {cache: true}) %>
14+
<%- partial('_plugin/analytics/tencent', {}, {cache: theme.fragment_cache}) %>
1515
<% } %>
1616
<% if (theme.analytics.tencent_mta_id) { %>
17-
<%- partial('_plugin/analytics/tencent-mta', {}, {cache: true}) %>
17+
<%- partial('_plugin/analytics/tencent-mta', {}, {cache: theme.fragment_cache}) %>
1818
<% } %>

layout/_partial/head/dns-prefetch.ejs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<% if(theme.comment.use === "changyan") { %>
99
<link rel="dns-prefetch" href="//changyan.sohu.com">
1010
<% } %>
11-
<% if ( (theme.comment.use === "disqus") || (theme.comment.use === "disqus_click") ) { %>
11+
<% if (theme.comment.use === "disqus") { %>
1212
<link rel="dns-prefetch" href="//disqus.com">
1313
<link rel="dns-prefetch" href="//<%= theme.comment.disqus.shortname %>.disqus.com">
1414
<% } %>
@@ -28,12 +28,22 @@
2828
<% } %>
2929

3030
<!-- analytics -->
31-
<% if(theme.analytics.use === "baidu") { %>
31+
<% if(theme.analytics.baidu_site_id) { %>
3232
<link rel="dns-prefetch" href="//hm.baidu.com">
3333
<% } %>
34-
<% if(theme.analytics.use === "google") { %>
34+
<% if(theme.analytics.google_site_id) { %>
3535
<link rel="dns-prefetch" href="//www.google-analytics.com">
3636
<% } %>
37-
<% if(theme.analytics.use === "cnzz") { %>
37+
<% if(theme.analytics.gtags_site_id) { %>
38+
<link rel="dns-prefetch" href="//www.googletagmanager.com">
39+
<link rel="dns-prefetch" href="//www.google-analytics.com">
40+
<% } %>
41+
<% if(theme.analytics.cnzz_site_id) { %>
3842
<link rel="dns-prefetch" href="//s95.cnzz.com">
3943
<% } %>
44+
<% if(theme.analytics.tencent_site_id) { %>
45+
<link rel="dns-prefetch" href="//tajs.qq.com">
46+
<% } %>
47+
<% if(theme.analytics.tencent_mta_id) { %>
48+
<link rel="dns-prefetch" href="//pingjs.qq.com">
49+
<% } %>

layout/_partial/head/main.ejs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
GitHub: https://github.com/SukkaW/hexo-theme-suka
66
Version: <%= theme.verison %>
77
-->
8-
<%- partial('_partial/head/lsversion', {}, {cache: true}) %>
8+
<%- partial('_partial/head/lsversion', {}, {cache: theme.fragment_cache}) %>
99

1010
<!-- ### DNS Prefetch ### -->
11-
<%- partial('_partial/head/dns-prefetch', {}, {cache: true}) %>
11+
<%- partial('_partial/head/dns-prefetch', {}, {cache: theme.fragment_cache}) %>
1212

1313
<!-- ### Meta & Title & Info ### -->
1414
<%- partial('_partial/head/meta') %>
@@ -21,19 +21,19 @@
2121
<% } %>
2222

2323
<!-- ### Site Verification ### -->
24-
<%- partial('_partial/head/site-verification', {}, {cache: true}) %>
24+
<%- partial('_partial/head/site-verification', {}, {cache: theme.fragment_cache}) %>
2525

2626
<!-- ### RSS ### -->
27-
<%- partial('_partial/head/rss', {}, {cache: true}) %>
27+
<%- partial('_partial/head/rss', {}, {cache: theme.fragment_cache}) %>
2828

2929
<!-- ### WebApp ### -->
30-
<%- partial('_partial/head/webapp', {}, {cache: true}) %>
30+
<%- partial('_partial/head/webapp', {}, {cache: theme.fragment_cache}) %>
3131

3232
<!-- ### The Open Graph & Twitter Card Protocol ### -->
3333
<%- partial('_partial/head/open-graph') %>
3434

3535
<!-- ### Analytics ### -->
36-
<%- partial('_partial/head/analytics', {}, {cache: true}) %>
36+
<%- partial('_partial/head/analytics', {}, {cache: theme.fragment_cache}) %>
3737

3838

3939
<!-- ### Canonical link ### -->
@@ -43,6 +43,6 @@
4343
<%- partial('_partial/head/structured-data') %>
4444

4545
<!-- ### Custom Head ### -->
46-
<%- partial('_partial/head/custom-head', {}, {cache: true}) %>
46+
<%- partial('_partial/head/custom-head', {}, {cache: theme.fragment_cache}) %>
4747

4848
</head>

layout/_partial/head/meta.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<title><% if (suka_title) { %><%= suka_title + ' | ' %><% } %><%= config.title %></title>
99

1010
<!-- favicon -->
11-
<%- partial('_partial/head/favicon', {}, {cache: true}) %>
11+
<%- partial('_partial/head/favicon', {}, {cache: theme.fragment_cache}) %>
1212

1313
<meta name="format-detection" content="telephone=no">
1414

layout/_partial/head/structured-data.ejs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,19 @@ function suka_img_url_for(url) {
5555
"@type": "BlogPosting",
5656
"mainEntityOfPage": {
5757
"@type": "WebPage",
58-
"@id": "<%- config.url %>"
58+
"@id": "<%= page.permalink %>"
5959
},
6060
"headline": "<%= suka_title %>",
6161
<% if(page.thumbnail) { %>
62-
"image": "<%= suka_img_url_for(page.thumbnail) %>",
62+
"image": {
63+
"@type": "ImageObject",
64+
"url": "<%= suka_img_url_for(page.thumbnail) %>"
65+
},
66+
<% } else { %>
67+
"image": {
68+
"@type": "ImageObject",
69+
"url": "<%= suka_std_icon %>"
70+
},
6371
<% } %>
6472
"datePublished": "<%= date_xml(page.date) %>",
6573
"dateModified": "<%= date_xml(page.updated) %>",

layout/_partial/header.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
<% } %>
1313
</p>
1414

15-
<%- partial('_partial/index-nav', {}, {cache: true}) %>
15+
<%- partial('_partial/index-nav', {}, {cache: theme.fragment_cache}) %>
1616
</header>

layout/_partial/index-nav.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<section class="navbar-section text-center">
1+
<nav class="navbar-section text-center">
22
<% if (theme.nav.home.use === true) { %>
33
<a href="<%= url_for('/') %>" class="navbar-link"><%= __('home') %></a>
44
<% } %>
@@ -12,9 +12,9 @@
1212
<a href="<%= theme.nav.pages[i].link %>" class="navbar-link"><%= i %></a>
1313
<% } %>
1414
<% if (theme.nav.share.use === true) { %>
15-
<%- partial('_partial/menu/index-share', {}, {cache: true}) %>
15+
<%- partial('_partial/menu/index-share', {}, {cache: theme.fragment_cache}) %>
1616
<% } %>
1717
<% if (theme.nav.rss.use === true) { %>
1818
<a href="<%= url_for(config.feed.path) %>" target="_blank" class="navbar-link">RSS</a>
1919
<% } %>
20-
</section>
20+
</nav>

0 commit comments

Comments
 (0)