hugo-theme-codex
hugo-theme-codex copied to clipboard
Make tag breadcrumb href value dynamic
Hi @jakewies - I really like your theme and I made this change in my fork since I have a different URL for my blog.
Hey @miketmoore ! Glad you're enjoying the project. This a useful change. Hardcoded urls in a theme should definitely be avoided. My only concern is that we aren't defining .Site.params.blogurl. Unless this is a built-in Hugo value (which I don't think it is), we'd have to make further adjustments:
- Add a default value to
exampleSite/config.toml - Document in the README that this value exists
- Make sure that anywhere else in the project using a hardcoded
"/blog"string gets refactored to.Site.params.blogurl
I'd also prefer to use camel casing, so .Site.params.blogUrl.
What do you think?
Thanks for the response @jakewies - I agree with you on all points! I'll make the updates. Thanks!
Will this change break existing sites until people add the field to their config file?
@RLesser I believe existing sites running this theme won't receive the change unless they pull in changes. But I could be wrong. I'm not too familiar with using a Hugo theme since I technically don't use one.
Thanks for the feedback everybody. I haven't forgotten about this but have been very busy. I'll try to get to it sooner than later.
Hey @miketmoore , just pinging to see if there is any update on this 😄
Should this also include a change for seo-schema.html?
https://github.com/jakewies/hugo-theme-codex/blob/da2d16a4f95fc37e71548dfc139d51e22ebb09bd/layouts/partials/seo-schema.html#L4
@jakewies @miketmoore
@jakewies Sorry to leave this sitting here. I'll try to make time soon! I'll also review the other comments by @RLesser and @estahn.