Skip to content

Commit cec53cf

Browse files
authored
Improved canonical path for vision in Google. (theme-next#748)
* Improved canonical path for vision in Google. From now all links will be not only without 'index.html', but without `.html` too. * Changed links in tag plugins. * Changed links in config.
1 parent 7ca8c70 commit cec53cf

File tree

12 files changed

+21
-20
lines changed

12 files changed

+21
-20
lines changed

_config.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ scheme: Muse
185185

186186
# ---------------------------------------------------------------
187187
# Sidebar Settings
188-
# See: https://theme-next.org/docs/theme-settings/sidebar/
188+
# See: https://theme-next.org/docs/theme-settings/sidebar
189189
# ---------------------------------------------------------------
190190

191191
# Posts / Categories / Tags in sidebar.
@@ -290,7 +290,7 @@ chat:
290290

291291
# ---------------------------------------------------------------
292292
# Post Settings
293-
# See: https://theme-next.org/docs/theme-settings/posts/
293+
# See: https://theme-next.org/docs/theme-settings/posts
294294
# ---------------------------------------------------------------
295295

296296
# Set the text alignment in the posts.
@@ -597,7 +597,7 @@ calendar:
597597

598598
# ---------------------------------------------------------------
599599
# Comments and Widgets
600-
# See: https://theme-next.org/docs/third-party-services/comments-and-widgets/
600+
# See: https://theme-next.org/docs/third-party-services/comments-and-widgets
601601
# ---------------------------------------------------------------
602602

603603
# Disqus
@@ -682,7 +682,7 @@ gitalk:
682682

683683
# ---------------------------------------------------------------
684684
# Content Sharing Services
685-
# See: https://theme-next.org/docs/third-party-services/content-sharing-services/
685+
# See: https://theme-next.org/docs/third-party-services/content-sharing-services
686686
# ---------------------------------------------------------------
687687

688688
# Baidu Share
@@ -741,7 +741,7 @@ needmoreshare2:
741741

742742
# ---------------------------------------------------------------
743743
# Statistics and Analytics
744-
# See: https://theme-next.org/docs/third-party-services/statistics-and-analytics/
744+
# See: https://theme-next.org/docs/third-party-services/statistics-and-analytics
745745
# ---------------------------------------------------------------
746746

747747
# Baidu Analytics ID
@@ -841,7 +841,7 @@ busuanzi_count:
841841

842842
# ---------------------------------------------------------------
843843
# Search Services
844-
# See: https://theme-next.org/docs/third-party-services/search-services/
844+
# See: https://theme-next.org/docs/third-party-services/search-services
845845
# ---------------------------------------------------------------
846846

847847
# Algolia Search
@@ -874,7 +874,7 @@ local_search:
874874

875875
# ---------------------------------------------------------------
876876
# Chat Services
877-
# See: https://theme-next.org/docs/third-party-services/chat-services/
877+
# See: https://theme-next.org/docs/third-party-services/chat-services
878878
# ---------------------------------------------------------------
879879

880880
# Chatra Support
@@ -1023,7 +1023,7 @@ canvas_ribbon:
10231023
#! ---------------------------------------------------------------
10241024
#! DO NOT EDIT THE FOLLOWING SETTINGS
10251025
#! UNLESS YOU KNOW WHAT YOU ARE DOING
1026-
#! See: https://theme-next.org/docs/advanced-settings/
1026+
#! See: https://theme-next.org/docs/advanced-settings
10271027
#! ---------------------------------------------------------------
10281028

10291029
# Script Vendors. Set a CDN address for the vendor you want to customize.

layout/_partials/head/head-unique.swig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
<link rel="alternate" href="{{ url_for(theme.rss) }}" title="{{ title }}" type="application/atom+xml"/>
1515
{% endif %}
1616

17-
{# Canonical, good for google search engine (SEO) : https://support.google.com/webmasters/answer/139066 #}
1817
{% if theme.canonical %}
19-
<link rel="canonical" href="{{ config.url }}/{{ page.canonical_path.replace('index.html', '') }}"/>
18+
{% set without_index = url.replace('index.html', '') %}
19+
{% set without_html = without_index.replace('.html', '') %}
20+
<link rel="canonical" href="{{ without_html }}"/>
2021
{% endif %}
2122

2223
{# Exports some front-matter variables to Front-End #}

scripts/tags/button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* button.js | https://theme-next.org/docs/tag-plugins/button/
2+
* button.js | https://theme-next.org/docs/tag-plugins/button
33
*/
44

55
/* global hexo */

scripts/tags/exturl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* exturl.js | https://theme-next.org/docs/tag-plugins/exturl/
2+
* exturl.js | https://theme-next.org/docs/tag-plugins/exturl
33
* Note: need to remove in NexT v7.0.0
44
*/
55

scripts/tags/full-image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* full-image.js | https://theme-next.org/docs/tag-plugins/full-image/
2+
* full-image.js | https://theme-next.org/docs/tag-plugins/full-image
33
*/
44

55
/* global hexo */

scripts/tags/group-pictures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* group-pictures.js | https://theme-next.org/docs/tag-plugins/group-pictures/
2+
* group-pictures.js | https://theme-next.org/docs/tag-plugins/group-pictures
33
*/
44

55
/* global hexo */

scripts/tags/label.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* label.js | https://theme-next.org/docs/tag-plugins/label/
2+
* label.js | https://theme-next.org/docs/tag-plugins/label
33
*/
44

55
/* global hexo */

scripts/tags/mermaid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* mermaid.js | https://theme-next.org/docs/tag-plugins/mermaid/
2+
* mermaid.js | https://theme-next.org/docs/tag-plugins/mermaid
33
*/
44

55
/* global hexo */

scripts/tags/note.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* note.js | https://theme-next.org/docs/tag-plugins/note/
2+
* note.js | https://theme-next.org/docs/tag-plugins/note
33
*/
44

55
/* global hexo */

scripts/tags/pdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* pdf.js | https://theme-next.org/docs/tag-plugins/pdf/
2+
* pdf.js | https://theme-next.org/docs/tag-plugins/pdf
33
*/
44

55
/* global hexo */

0 commit comments

Comments
 (0)