-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
hugo new theme does not create a baseof.html #3576
Comments
Hello @juh2,
We make no assumptions about the user and the structure of his theme. Block templates are still optional, hence they don't have to be used by default. But it would make sense to encourage theme creators to make use of If you think What remains is the question whether the adoption of block templates outweighs the assumptions of the users and his intended theme structure. |
Thanks for the clarification. I see no obvious button to label this issue as feature request. Could someone with more insight or rights do this? TIA |
I agree with @juh2 that most would really want a |
Here's what is currently generated:
How about the addition of
|
Let us keep this issue about ... |
You mentioned a |
The general tenor of the comments seems to supports this proposal. I would to extend this thought by linking the files together as follows: Hugo generates {{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}}
|
I would second the idea of including some partial calls as noted above by @digitalcraftsman. Simple enough to clue in new users and not so complicated that people end up deleting a bunch of scaffolding to get up and running... |
@digitalcraftsman I think the header/footer is an antipattern that the |
@bep with my understanding of your comment you propose that Would a minimalistic <html>
<head>
<title>Hugo</title>
<!-- some other stuff -->
</head>
<body>
<div id="content">
{{- block "main" . }}{{- end }}
</div>
<footer>
<!-- copyright etc. -->
</footer>
</body>
</html> I see the inclusion of the |
The partial pattern is still useful and should still be part of the scheleton, as long as the templates are well formed: <html>
{{- partial "header.html" . -}}
<body>
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html> Or variants of the above. In the above, all templates are well formed (base + footer + partial). |
Got it. |
If I may get more granular, I would only suggest that there be a <html>
<head>
{{- partial "head.html" . -}}
</head>
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html> Anything more than this, though, and I'm probably just getting too opinionated 😄 |
@rdwatters sure, but in your example |
This would be a good start: <html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html> |
How about... <html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html> |
And we crossed streams. Oops. |
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
I got here from:
digitalcraftsman wrote:
Sounds like a great idea! Both bep and rdwatters wrote: <html>
{{- partial "head.html" . -}}
<body>
{{- partial "header.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{- partial "footer.html" . -}}
</body>
</html> Hohoho! Great minds think alike! Since everyone has come to a consensus, I think it would be interesting to implement it in |
Thanks to @digitalcraftsman, @bep and @rdwatters for providing the actual content of the default baseof.html file. Fixes gohugoio#3576
Thanks to @digitalcraftsman, @bep and @rdwatters for providing the actual content of the default baseof.html file. Fixes #3576
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
As Block-Templates are the new default I think that the directory layout of a theme created by
hugo new
should reflect this and create abaseof.html
in_default
.The text was updated successfully, but these errors were encountered: