Skip to content

Commit

Permalink
theme: make migration easier #891
Browse files Browse the repository at this point in the history
content.html is meant to be overloaded by the user and it should just work
so every logic needs to be put somewhere else
  • Loading branch information
McShelby committed Sep 13, 2024
1 parent 8970178 commit 8103621
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/views/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</header>
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}

{{ partial "content.html" . | safeHTML }}
{{ partial "article-content.html" . }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
Expand Down
2 changes: 1 addition & 1 deletion layouts/chapter/views/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ partial "heading-pre.html" . }}<div class="article-subheading">{{ T "Chapter" .Params.Weight }}</div>
{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}

{{ partial "content.html" . | safeHTML }}
{{ partial "article-content.html" . }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
Expand Down
2 changes: 1 addition & 1 deletion layouts/home/views/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</header>
{{ partial "heading-pre.html" . }}{{ partial "heading.html" . }}{{ partial "heading-post.html" . }}

{{ partial "content.html" . | safeHTML }}
{{ partial "article-content.html" . }}
<footer class="footline">
{{- partial "content-footer.html" . }}
</footer>
Expand Down
4 changes: 4 additions & 0 deletions layouts/partials/article-content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{/* the following check avoids to print out content of headless bundles if called from nestedContent.gotmpl */}}
{{- if .RelPermalink }}
{{- partial "content.html" . | safeHTML }}
{{- end }}
5 changes: 1 addition & 4 deletions layouts/partials/content.html
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
{{- /* the following check avoids to print out content of headless bundles if called from nested-content.html */}}
{{- if partial "permalink.gotmpl" (dict "to" .) }}
{{- .Content }}
{{- end }}
{{ .Content }}

0 comments on commit 8103621

Please sign in to comment.