Skip to content

Commit

Permalink
feat: Add canonical setting
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Feb 10, 2020
1 parent 19b81fa commit bf997d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ shake_file: true
# Remember to set up your site-subtitle in Hexo `_config.yml`.
index_subtitle: false

# Set a canonical link tag for your Hexo site.
# See: https://support.google.com/webmasters/answer/139066
# Remember to set up your URL in Hexo `_config.yml` (e.g. url: http://yoursite.com)
canonical: true

# Webmaster tools verification setting
# ---------------------------------------------------------------
# Google Webmaster tools verification setting
Expand Down
3 changes: 3 additions & 0 deletions layout/_partials/head/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ if theme.favicon.msapplication
meta(name="msapplication-TileImage" content=`${url_for(theme.favicon.msapplication)}`)
meta(name="msapplication-TileColor" content="#000000")

if theme.canonical
link(ref="canonical" href=full_url_for(page.path))

if _.get(theme, 'feed.rss')
link(rel="alternate" href=url_for(theme.feed.rss) type="application/atom+xml")

Expand Down

0 comments on commit bf997d6

Please sign in to comment.