diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2023-02-15 15:48:11 -0800 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-02-15 15:48:11 -0800 |
| commit | 5889d70a97c142805c34faf42fd0f933df9e3bdc (patch) | |
| tree | 6d7016a16d79d3fe4bb35e0b3919125bb792d5f9 /src/Text | |
| parent | fd3b955fe5094478d1bcbc3e91c82e3099f54516 (diff) | |
Retain metadata in processing sections for chunked HTML.
Previously we suppressed metadata in all but the top page,
in order to prevent the title block from being printed
on every page. This prevented use of custom variables set
by metadata fields.
This commit moves to a better solution: a conditional
in the default template restricts the title block to the
top page.
Closes #8620.
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/ChunkedHTML.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/ChunkedHTML.hs b/src/Text/Pandoc/Writers/ChunkedHTML.hs index 940e469e1..392b88a9f 100644 --- a/src/Text/Pandoc/Writers/ChunkedHTML.hs +++ b/src/Text/Pandoc/Writers/ChunkedHTML.hs @@ -39,6 +39,7 @@ import Data.Aeson (toJSON, encode) import System.FilePath (isRelative, normalise) import Data.List (isInfixOf) import Text.Pandoc.Walk (walkM) +import Text.Pandoc.Builder (setMeta) -- | Splits document into HTML chunks, dividing them by section, -- and returns a zip archive of a folder of files. @@ -120,10 +121,7 @@ chunkToEntry opts meta topChunk chunk = do where opts' = opts{ writerVariables = addContextVars opts' topChunk chunk $ writerVariables opts } - meta' = if chunk == topChunk - then meta - else Meta $ M.fromList [("pagetitle", MetaString - (stringify $ chunkHeading chunk))] + meta' = setMeta "pagetitle" (MetaString (stringify $ chunkHeading chunk)) meta blocks = chunkContents chunk tocTreeToContext :: Tree SecInfo -> Context Text |
