Add support for using the filename as the page title

This commit is contained in:
Dennis Verheijden
2025-08-29 14:37:59 +02:00
committed by Manuel Rüger
parent ae5347053a
commit 0f13d249f5
5 changed files with 38 additions and 18 deletions

View File

@@ -61,6 +61,12 @@ var Flags = []cli.Flag{
Usage: "extract page title from a leading H1 heading. If no H1 heading on a page exists, then title must be set in the page metadata.",
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_FROM_H1"), altsrctoml.TOML("title-from-h1", altsrc.NewStringPtrSourcer(&filename))),
},
&cli.BoolFlag{
Name: "title-from-filename",
Value: false,
Usage: "use the filename (without extension) as the Confluence page title if no explicit 'Title' header or H1 heading is found.",
Sources: cli.NewValueSourceChain(cli.EnvVar("MARK_TITLE_FROM_FILENAME"), altsrctoml.TOML("title-from-filename", altsrc.NewStringPtrSourcer(&filename))),
},
&cli.BoolFlag{
Name: "title-append-generated-hash",
Value: false,