I've worked hard to get my theme ready to share with the world!
It's at https://github.com/xaprb/story and my website that uses it is at https://www.xaprb.com/
Hey Baron,
thank you for sharing this theme with the Hugo community :+1:
While checking your theme with the build script for the Hugo theme site, which also generates a demo for your theme, I noticed that a few assets couldn't be fetched. This mainly affects images like the header image and the search index for Lunr.js.
Theme demos are hosted in a subdirectory at https://themes.gohugo.io/theme/YOUR_THEME. You're assets however are linked relative to the root directory / which isn't necessarily equivalent to the baseurl as you see. It's advisable to use the absURL template function which handles such cases for your.
To fix this issue you just have to pipe all file paths to an assets into absURL like this:
{{ "path/to/image.png" | absURL }}
Please note that the paths don't start with a slash. Otherwise absURL will make the paths in all cases relative to the root directory. Don't forget the search index over here. Otherwise the search doesn't work :smile:
Thank you! I will work on this.
I've reviewed, changed, and merged. There's a couple things I'd like to mention to you:
Thanks!
Hello @xaprb
Your theme loads without its local CSS and JS assets. Please review the updated README to resolve these issues.
For example you load your stylesheet like this: {{ "/css/" | absURL }} in Hugo links that start with a slash are made relative and absURL has no effect. You theme's demo will live in a subdirectory of the Hugo site. A relative URL is always relative to the root, therefore your theme's assets have the wrong URL when I execute the Themes Site Build Script.
Please look into the above and let me know.
Will do, thanks. That was not clear to me before, so thanks for pointing it out.
Is there a way I can run (or preview) the themes site build script, so that I can check for errors before I ask you to take another look?
Full instructions about running the Build Script locally are in the updated README.
If you have any questions just ask.
OK I got it all working. Thanks for your help!
@xaprb Great! 馃憤
@digitalcraftsman This theme looks fine on my end, you can add it to the website.
Your theme should appear soon on Hugo's theme site. Next, I'll promote your theme on Hugo's official Twitter account.
Wonderful!
I'm not sure the right place to ask this, but I've updated some of the content in Story that should get built into the theme site, like the demo site and the README. When you refresh/update the theme site, will that get updated automatically?
When you refresh/update the theme site, will that get updated automatically?
@xaprb Yes. The changes will be reflected in your theme's demo the next time that the themes are updated in this repo.
Thank you! Related question, when I browse to Story in the themes site and then click Demo, I go to https://themes.gohugo.io/theme/story/. I expected the example site that's included in the theme to be there, but I see the generic theme demo site there instead. Is this a bug in my theme's metadata files that I should fix? Or is it a bug in building the themes site?
@xaprb This was changed recently for security reasons. See: https://github.com/gohugoio/hugoThemes/pull/547
This change will also be reflected in the repository README once https://github.com/gohugoio/hugoThemes/issues/548 is merged.
Thank you鈥攖his makes total sense. Also, I really appreciate how attentive and responsive you are to these comments, you are a great contributor to Hugo!
@xaprb I've updated all themes a moment ago
Also, I really appreciate how attentive and responsive you are to these comments, you are a great contributor to Hugo!
I can only second that!