From 26f58b7d9208c7a479f56dc5714e9c07fa598277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sat, 24 Feb 2024 13:49:46 +0100 Subject: [PATCH] docs: canonifyURLs is unnessessary --- exampleSite/config/_default/hugo.toml | 11 +++-------- exampleSite/content/basics/customization/_index.en.md | 9 +++++---- exampleSite/content/basics/migration/_index.en.md | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/exampleSite/config/_default/hugo.toml b/exampleSite/config/_default/hugo.toml index 005fb882d2..a5f0263716 100644 --- a/exampleSite/config/_default/hugo.toml +++ b/exampleSite/config/_default/hugo.toml @@ -3,17 +3,12 @@ # set it like "https://example.com/mysite/" baseURL = "https://example.com/" -# canonicalization will only be used for the sitemap.xml and index.xml files; -# if set to false, a site served from a subdirectory will generate wrong links -# inside of the above mentioned files; if you serve the page from the servers root -# you are free to set the value to false as recommended by the official Hugo documentation -canonifyURLs = true # true -> all relative URLs would instead be canonicalized using baseURL # required value to serve this page from a webserver AND the file system; # if you don't want to serve your page from the file system, you can also set this value # to false -relativeURLs = true # true -> rewrite all relative URLs to be relative to the current content -# if you set uglyURLs to false, this theme will append 'index.html' to any branch bundle link -# so your page can be also served from the file system; if you don't want that, +relativeURLs = false # true -> rewrite all site-relative URLs (those with a leading slash) to be relative to the current content +# if you set uglyURLs to false, this theme will append 'index.html' to any page bundle link +# so your site can be also served from the file system; if you don't want that, # set disableExplicitIndexURLs=true in the [params] section uglyURLs = false # true -> basic/index.html -> basic.html diff --git a/exampleSite/content/basics/customization/_index.en.md b/exampleSite/content/basics/customization/_index.en.md index 6987ea36ff..46ae5f2b04 100644 --- a/exampleSite/content/basics/customization/_index.en.md +++ b/exampleSite/content/basics/customization/_index.en.md @@ -9,11 +9,8 @@ If your site is served from a subfolder, eg. `https://example.com/mysite/`, you ````toml baseURL = "https://example.com/mysite/" -canonifyURLs = true -relativeURLs = true ```` -Without `canonifyURLs=true` URLs in sublemental pages (like `sitemap.xml`, `rss.xml`) will be generated falsly while your HTML files will still work. See https://github.com/gohugoio/hugo/issues/5226. ## Serving your page from the filesystem @@ -31,7 +28,11 @@ The theme will append an additional `index.html` to all page bundle links by def ```` {{% notice note %}} -If you want to use the search feature from the file system using an older installation of the theme make sure to change your outputformat for the homepage from the now deprecated `json` to `search` [as seen below](#activate-search). +Sublemental pages (like `sitemap.xml`, `rss.xml`) will always be generated with fully quallyfied URLs and will not work if your site is served from the filesystem. +{{% /notice %}} + +{{% notice note %}} +If you want to use the search feature from the file system, migrating from an older installation of the theme, make sure to change your outputformat for the homepage from the now deprecated `json` to `search` [as seen below](#activate-search). {{% /notice %}} ## Activate search diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index 8dc971f38f..8854e7852b 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -703,7 +703,7 @@ This document shows you what's new in the latest release and flags it with one o ## 2.6.0 (2021-10-21) {#260} -- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Your site can now be served from a subfolder if you set `baseURL` and `canonifyURLs=true` in your `hugo.toml`. See the [documentation](basics/customization#serving-your-page-from-a-subfolder) for a detailed example. +- {{% badge style="info" icon="plus-circle" title=" " %}}New{{% /badge %}} Your site can now be served from a subfolder if you set `baseURL` in your `hugo.toml`. See the [documentation](basics/customization#serving-your-page-from-a-subfolder) for a detailed example. ---