Skip to content

Commit aa52e6e

Browse files
committed
Improve content check for pages by validating word count and plain text content
1 parent 6195ae1 commit aa52e6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

module/layouts/_partials/functions/get-guide-translations-for-version.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@
8888
{{ $hasPage := false }}
8989
{{ if $page }}
9090
{{ $hasPage = true }}
91-
{{/* Check if page has content */}}
92-
{{ $hasContent = and $page.Content (ne (trim $page.Content " \n\r\t") "") }}
91+
{{/* Check if page has actual content by checking plain text content and word count */}}
92+
{{ $plainContent := trim $page.Plain " \n\r\t" }}
93+
{{ $hasContent = and (gt $page.WordCount 0) (ne $plainContent "") }}
9394
{{ end }}
9495

9596
{{/* Check if PDF is available and get PDF path */}}

0 commit comments

Comments
 (0)