Blog post settings

When you extend a BlogPostPage you get support for a static blog post page.
For a Bootstrap-themed blogpost page extend HepekBootstrap5BlogPage.

You can override def blogSettings method with following fields:

NameMandatoryTypeDefault valueDescription
authorNoOption[String]NoneAuthor of this post
createDateNoOption[LocalDate]NoneDate when this post was written
sectionsNoList[Section]List.emptySections of this post
dateFormatNoDateTimeFormatterdd.MM.yyyySections of this post

Sections

Instead of overriding pageContent, here you specify withSections on blogSettings.
A blog post is made of sections, so you can render a nice TOC, sitemap.xml, or even a PDF...
Sections are tree-like, they can contain other sections.
Every section has a name, content, and optionally child sections.
Code usually looks like this:


        package files

        object ExampleBlogPost extends MyBlogPostPage {
          override def blogSettings = super.blogSettings
            .withCreateDate(LocalDate.of(2018, 9, 5))
            .withSections(firstSection)

          val firstSection = Section(
            "Hello world!",
            p("Welcome to my blog!"),
            List( // child sections, optional
              Section(
                "..."
              )
            )
          )
        }
      

You can even get a link to a section!
ExampleBlogPost.firstSection.ref would return "example-blog-post.html#hello-world"