diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-08-30 11:11:20 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2023-08-30 10:11:20 +0200 |
commit | 3a8aad6b190bb3d7cecc8ec6bc8379a01ec547cb (patch) | |
tree | e729a451a1236797046f581ac068c32171c994a5 /hugolib/page.go | |
parent | a7b93e6564e6a4a7a3043b431e255ba716940408 (diff) | |
download | hugo-3a8aad6b190bb3d7cecc8ec6bc8379a01ec547cb.tar.gz hugo-3a8aad6b190bb3d7cecc8ec6bc8379a01ec547cb.zip |
Fix .RawContent for empty content pages (#11407)
Fixes #11406
Diffstat (limited to 'hugolib/page.go')
-rw-r--r-- | hugolib/page.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hugolib/page.go b/hugolib/page.go index 81ba68aa4..27a60a186 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -328,6 +328,7 @@ func (p *pageState) RawContent() string { if start == -1 { start = 0 } + return string(p.source.parsed.Input()[start:]) } @@ -727,9 +728,7 @@ Loop: frontMatterSet = true next := iter.Peek() - if !next.IsDone() { - p.source.posMainContent = next.Pos() - } + p.source.posMainContent = next.Pos() if !p.s.shouldBuild(p) { // Nothing more to do. |