From 88e7c031a8cf7dfc058855f1bc18e3d35beac210 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Sat, 21 Feb 2015 14:46:12 -0700 Subject: [PATCH] [Docs] Clarify the switch to `canonifyurls = false` as default Quote from @spf13: "I also think it's the better default and should continue to be the case going forward." Also mention the use of `hugo config` to check the current value of `canonifyurls`, thanks to suggestion by @bep. Fixes #802 --- docs/content/extras/urls.md | 55 ++++++------------------------------- 1 file changed, 8 insertions(+), 47 deletions(-) diff --git a/docs/content/extras/urls.md b/docs/content/extras/urls.md index d9f545a49..20bf27d8b 100644 --- a/docs/content/extras/urls.md +++ b/docs/content/extras/urls.md @@ -32,20 +32,14 @@ Organization](/content/organization/) for more details. ## Canonicalization - By default, all relative URLs encountered in the input are left unmodified, -e.g. `/css/foo.css` would stay as `/css/foo.css`. +e.g. `/css/foo.css` would stay as `/css/foo.css`, +i.e. `canonifyurls` defaults to `false`. By setting `canonifyurls` to `true`, all relative URLs would instead be *canonicalized* using `baseurl`. For example, assuming you have `baseurl = http://yoursite.example.com/` defined in the site-wide -config.toml, the relative URL `/css/foo.css` would be turned into +`config.toml`, the relative URL `/css/foo.css` would be turned into the absolute URL `http://yoursite.example.com/css/foo.css`. Benefits of canonicalization include fixing all URLs to be absolute, which may @@ -56,46 +50,13 @@ Benefits of non-canonicalization include being able to have resource inclusion be scheme-relative, so that http vs https can be decided based on how this page was retrieved. -### Caveat: Default of `canonifyurls` changed in v0.11 +> Note: In the May 2014 release of Hugo v0.11, the default value of `canonifyurls` was switched from `true` to `false`, which we think is the better default and should continue to be the case going forward. So, please verify and adjust your website accordingly if you are upgrading from v0.10 or older versions. - - - - - - - - +To find out the current value of `canonifyurls` for your website, you may use the handy `hugo config` command added in v0.13: - - - - - - + hugo config | grep -i canon - - - - - +Or, if you are on Windows and do not have `grep` installed: - - - - - + hugo config | FINDSTR /I canon - - - - - - - - - - - - -
Hugo VersionRelease DateDefault
v0.92013-11-15canonifyurls = true (non-configurable)
v0.102014-03-01canonifyurls = true
v0.112014-05-29canonifyurls = false
v0.122014-09-01canonifyurls = false
v0.13-DEVin developmentcanonifyurls = false (as of January 2015)