From 4560a0169ab9bb772cb8d0c532c30579eb992a77 Mon Sep 17 00:00:00 2001 From: Alexandros Date: Fri, 30 Nov 2018 23:04:21 +0200 Subject: [PATCH] Update Warning for Theme Links (#676) The advice in this page is actually the opposite. Relative URLs output the wrong URL for theme assets on the Hugo website. See relevant advice in the repository's [README](https://github.com/gohugoio/hugoThemes#common-permalink-issues) I hadn't noticed this page (if I had noticed I would have sent a PR earlier because the advice offered here is plain wrong). The reason I am merging this PR right away is due to [this](https://github.com/gohugoio/hugoThemes/issues/504#issuecomment-443253163) comment by a confused theme author. If you feel that this could be improved feel free to reword and amend as you see fit but the bottom line is that for themes that are going to be published on Hugo Themes authors should create absolute paths in their templates. cc: @bep @digitalcraftsman @kaushalmodi --- content/en/themes/creating.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/themes/creating.md b/content/en/themes/creating.md index 1c1efc187..3950472a5 100644 --- a/content/en/themes/creating.md +++ b/content/en/themes/creating.md @@ -19,8 +19,8 @@ toc: true wip: true --- -{{% warning "Use Relative Links" %}} -If you're creating a theme with plans to share it with the community, use relative URLs since users of your theme may not publish from the root of their website. See [relURL](/functions/relurl) and [absURL](/functions/absurl). +{{% warning "Use Absolute Links" %}} +If you're creating a theme with plans to share it on the [Hugo Themes website](https://themes.gohugo.io/) please note that your theme's demo will be available in a sub-directory of website and for the theme's assets to load properly you will need to create absolute paths in the templates by using either the [absURL](/functions/absurl) function or `.Permalink`. Also make sure not to use a forward slash `/` in the beginning of a `PATH`, because Hugo will turn it into a relative URL and the `absURL` function will have no effect. {{% /warning %}} Hugo can initialize a new blank theme directory within your existing `themes` using the `hugo new` command: