Skip to content

Commit ef27686

Browse files
committed
fix: cleanup bookshop output to enable empty content warning
1 parent 07e303a commit ef27686

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

layouts/_partials/utilities/RenderContentBlocks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
{{ end }}
6262

6363
{{/* Render content blocks */}}
64-
{{ partial "bookshop_partial" (slice "page" $blocks) }}
64+
{{ return trim (partial "bookshop_partial" (slice "page" $blocks)) "\n\r " }}

layouts/single.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section
1717

1818
{{ $blocks | safeHTML }}
1919

20-
{{ if or (not $blocks) (gt (len .RawContent) 0) }}
20+
{{ if (gt (len .RawContent) 0) }}
2121
<div class="container-xxl flex-fill p-4 px-xxl-0">
2222
<div class="row row-cols-1 row-cols-{{ $breakpoint.current }}-2 row-cols-{{ $breakpoint.next }}-3">
2323
<div class="col col-{{ $breakpoint.next }}-2 d-none d-{{ $breakpoint.next }}-block sidebar-overflow sticky-top pt-5">
@@ -35,5 +35,7 @@ <h5 class="offcanvas-title" id="offcanvas-label">{{ strings.FirstUpper $.Section
3535
</div>
3636
</div>
3737
</div>
38+
{{ else if and (not $blocks) (eq (len .RawContent) 0)}}
39+
{{ warnf "Page %q has no content" .RelPermalink }}
3840
{{ end }}
3941
{{ end -}}

0 commit comments

Comments
 (0)