diff options
author | Alexandros <onedrawingperday@users.noreply.github.com> | 2018-12-17 21:29:11 +0300 |
---|---|---|
committer | digitalcraftsman <digitalcraftsman@users.noreply.github.com> | 2018-12-17 21:29:11 +0300 |
commit | b2b51bdc546fddf752b86f667e33238e99384fc9 (patch) | |
tree | fec8e250a1bcedadc8e3ed4ee72bb74739c832ae /README.md | |
parent | 84073b0e57f9cf109497ab39ead676fbb2b5243c (diff) |
Amend Common Permalink Issues in README
* Amend Common Permalink Issues
* Incorporate feedback
See #518
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -113,7 +113,10 @@ If your resources are not being published into the `public/resources` folder, ch The demo of your theme will be available in a sub-directory of the Hugo Themes website. -- You need to create absolute paths in the templates for the theme's assets, by using either the `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. +If you're creating a theme with plans to share it on the [Hugo Themes website](https://themes.gohugo.io/) please note the following: +- If using relative URLs in links, they must be quoted, e.g `<a href="{{ "/blog" | relURL }}">` and `<img src="{{ "/images/logo.png" | relURL }}">` +- If using inline styles you will need to use absolute URLs, for the linked assets to be served properly, e.g. `<div style="background: url('{{ "images/background.jpg" | absURL }}')">` +- Make sure not to use a forward slash `/` in the beginning of a `URL`, because it will point to the host root. Your theme's demo will be available in a subdirectory of the Hugo website and in this scenario Hugo will not generate the correct `URL` for theme assets. ## Testing a theme with the Hugo Themes website Build Script |