Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tag breadcrumb href value dynamic #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

miketmoore
Copy link

Hi @jakewies - I really like your theme and I made this change in my fork since I have a different URL for my blog.

This allows customizing the relative url used for linking to the "blog"
page.
@jakewies
Copy link
Owner

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?

@miketmoore
Copy link
Author

Thanks for the response @jakewies - I agree with you on all points! I'll make the updates. Thanks!

@RLesser
Copy link

RLesser commented Aug 9, 2020

Will this change break existing sites until people add the field to their config file?

@jakewies
Copy link
Owner

jakewies commented Aug 9, 2020

@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.

@@ -7,7 +7,7 @@

<div class="post-list__container">
<div class="tag__header">
<a href="/blog">All posts</a><span class="separator">/</span>
<a href="{{ .Site.Params.blogurl }}">All posts</a><span class="separator">/</span>
Copy link

@RLesser RLesser Aug 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a default option here so that this doesn't break sites that don't have that param specified.

<a href="{{ .Site.Params.blogurl | relURL | default `/blog` }}">All posts</a><span class="separator">/</span>

@miketmoore
Copy link
Author

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.

@jakewies
Copy link
Owner

Hey @miketmoore , just pinging to see if there is any update on this 😄

@estahn
Copy link

estahn commented Jan 10, 2021

Should this also include a change for seo-schema.html?

{{ if and (.IsPage) (eq .Section "blog") }}

@jakewies @miketmoore

@miketmoore
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants