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

tpl/tplimpl: Improve embedded opengraph template #12328

Merged
merged 1 commit into from
Apr 2, 2024

Conversation

jmooring
Copy link
Member

@jmooring jmooring commented Apr 1, 2024

Changes:

  • Add tags per documentation
  • Prefer site.Title over site.Params.title
  • Plainify titles, tags, and descriptions
  • Add fallback values for locale
  • Fix pages related by series
  • Improve readability

Closes #8296
Closes #8698
Closes #8991
Closes #9818
Closes #9866
Closes #10647


{{- range .GetTerms "series" }}
{{- range .Pages | first 7 }}
{{- if not ($.Eq .) }}
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer if we use eq and similar for equality checks. It's not like .Eq is going away, but it was added plainly to make eq work with wrapped page types.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've made the change. Let me know if I should remove PAGE.Eq from the docs. I guess I like the syntax, but I really don't care either way.

Copy link
Member

@bep bep Apr 2, 2024

Choose a reason for hiding this comment

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

My take on this is that

  • eq can be used with (almost) any Hugo object/type.
  • .Eq is only available on some types, so it's less portable and will break if people expect it to work on ... say strings.

Changes:

- Add tags per documentation
- Prefer site.Title over site.Params.title
- Plainify titles, tags, and descriptions
- Add fallback values for locale
- Fix pages related by series
- Improve readability

Closes gohugoio#8296
Closes gohugoio#8698
Closes gohugoio#8991
Closes gohugoio#9818
Closes gohugoio#9866
Closes gohugoio#10647

Co-authored-by: tomy0000000 <git@tomy.me>
Co-authored-by: sean-au <sean@powerfulwebdesign.com.au>
@bep bep merged commit 2da4ec5 into gohugoio:master Apr 2, 2024
8 checks passed
@jmooring jmooring deleted the improve-opengraph branch April 16, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants