Skip to content

Add partial decorators for better composability - #692

Open
agriyakhetarpal wants to merge 16 commits into
scientific-python:mainfrom
agriyakhetarpal:partial-decorators
Open

Add partial decorators for better composability#692
agriyakhetarpal wants to merge 16 commits into
scientific-python:mainfrom
agriyakhetarpal:partial-decorators

Conversation

@agriyakhetarpal

@agriyakhetarpal agriyakhetarpal commented Dec 31, 2025

Copy link
Copy Markdown
Member

This PR introduces partial decorators, a new feature in Hugo released with v0.154.0: https://github.com/gohugoio/hugo/releases/tag/v0.154.0. This will not be a user-facing change. The documentation is at https://gohugo.io/functions/templates/inner/ and is currently a bit sparse, but still understandable. From the docs: I have bumped to Hugo 0.155.0 with this PR, which is as far as we can go right now.

A partial decorator is a partial template called from any other template including shortcodes, render hooks, and other partials.

There are some more examples here: gohugoio/hugoDocs#3330.

I also tried to add something to deduplicate the grid of items and cards, but that turned out to be more complicated – the content inside needs access to outer variables such as $card and .body. I think we can go ahead with this, for now at least, since it's a net win for easy deduplication either way, and we can do this kind of work incrementally.

@netlify

netlify Bot commented Dec 31, 2025

Copy link
Copy Markdown

Deploy Preview for scientific-python-hugo-theme ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 31f91dc
🔍 Latest deploy log https://app.netlify.com/projects/scientific-python-hugo-theme/deploys/6a7a5122762eef00084c460f
😎 Deploy Preview https://deploy-preview-692--scientific-python-hugo-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94
Accessibility: 97
Best Practices: 100
SEO: 91
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@agriyakhetarpal
agriyakhetarpal marked this pull request as draft December 31, 2025 23:14
@agriyakhetarpal
agriyakhetarpal removed the request for review from stefanv December 31, 2025 23:14
@stefanv

stefanv commented Feb 9, 2026

Copy link
Copy Markdown
Member

I like the direction this is taking 👍

@stefanv

stefanv commented Feb 9, 2026

Copy link
Copy Markdown
Member

Also, it's neat that Hugo finally added that feature!

@stefanv

This comment was marked as resolved.

@agriyakhetarpal agriyakhetarpal changed the title A start towards partial decorators for better composability Add partial decorators for better composability Mar 11, 2026
@agriyakhetarpal

This comment was marked as resolved.

@agriyakhetarpal
agriyakhetarpal marked this pull request as ready for review March 11, 2026 07:20
@agriyakhetarpal
agriyakhetarpal requested a review from stefanv March 11, 2026 07:20
@agriyakhetarpal agriyakhetarpal added this to the 0.23 milestone Mar 11, 2026
@stefanv

This comment was marked as off-topic.

@agriyakhetarpal

This comment was marked as off-topic.

@agriyakhetarpal

This comment was marked as off-topic.

@stefanv

This comment was marked as off-topic.

@stefanv

This comment was marked as off-topic.

@agriyakhetarpal

This comment was marked as off-topic.

@agriyakhetarpal

Copy link
Copy Markdown
Member Author

I spent some time thinking about what can be done here, since the author of the Atom feed is unresponsive to PRs (and that is unfortunate as is). I think I have a solution, which is simply that we just shouldn't bump to Hugo 0.157.0 here – we should only bump to Hugo 0.155.0, and that will allow us to have a cleaner separation of concerns.

This way, this PR can now be merged without messing with the Atom feed theme. That theme being broken is a consequence of upgrading to Hugo 0.156.0 and later, which removed the site.Author field. I'll create a separate issue about what we can do for the Hugo 0.156.0 update and add some context there. As it stands, this PR is now unblocked.

@agriyakhetarpal
agriyakhetarpal enabled auto-merge (squash) August 10, 2026 22:36
@agriyakhetarpal

Copy link
Copy Markdown
Member Author

Could you PTAL now, @stefanv? The diff is much smaller, and the PR should be far easier to digest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants