-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Move partials and shortcodes out of layouts #13626
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
Comments
While 1/2 may be possible with multiple roots, it would be very expensive to implement/change.
We have renamed them |
Then shouldn't /assets also be under /layouts? Why can't the root directory be the common root?
I don't see why these changes would preclude being able to do this?
Don't _shortcodes and _partials have that same issue?
Fair enough, but deciding not to do something because of implementation cost is different than deciding not to do something because it's a bad idea. |
Personally, I like the Hugo way of grouping partials and shortcodes within layouts. If in case the proposal to shift them is accepted, I would prefer if the current behaviour is maintained somehow, or made configurable. |
I'll add that while the implementation cost might be too high for existing contributors, it might be motivational for newcomers (like me) to get involved. |
(I didn't get a response to https://discourse.gohugo.io/t/hugo-v0-146-0-and-v0-146-1-released/54300/5?u=will, so I will carry over the unaddressed stuff from #13476 here.)
I never understood why they're in /layouts: they're not layouts. They also conflict with /content/partials and /content/shortcodes sections that have their own layouts. It also needlessly deepens the directory depth, making it slow to change directories or click around a file explorer.
Make /layouts/partials a fallback for /partials, then deprecate /layouts/partials.
Make /layouts/shortcodes a fallback for /shortcodes, then deprecate /layouts/shortcodes.
While we're at it, reconsider the names "partials" and "shortcodes". They're really general-purpose templates and templates for content, respectively. Perhaps partial -> template and shortcode -> snippet (snippets can be parameterized, as in the context of text editors)?
And while we're at it, rename baseof.html to base.html (or _base.html if needed in /layouts) with a deprecation like above.
The text was updated successfully, but these errors were encountered: