class

Hwaro::Services::Exporters::JekyllExporter

Inherits Hwaro::Services::Exporters::Base < Reference < Object

Constants

DATE_SHAPE_RE = /\A\d{4}-\d{2}-\d{2}([Tt ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?( ?([Zz]|[+-]\d{2}:?\d{2}))?)?\z/

Matches the date/timestamp shapes Jekyll's YAML loader reads natively; anything else is emitted via yaml_scalar — raw interpolation of an arbitrary string into date: let a newline or : inject or break the frontmatter.

HANDLED_KEYS = Set {"title", "date", "description", "draft", "tags", "categories", "authors", "image", "template"}

Keys the explicit emitters below may claim; everything else passes through as a Jekyll page variable (Jekyll accepts arbitrary front-matter keys, so dropping slug, weight, layout, extra.*, … was silent data loss — the same bug class gh#527 fixed for the Hugo exporter). A key is only excluded from the passthrough when its emitter actually produced a line: a value the emitter cannot represent (hash-valued tags, array title, …) used to be swallowed — skipped by the emitter AND skipped by name here.

POST_SECTIONS = ["posts", "blog"] of ::String

Top-level sections whose dated content maps to Jekyll's _posts/ collection. posts is what the Jekyll importer itself produces (round-trip symmetric) and blog is the other common Hwaro layout. Membership in one of these sections — not the mere presence of a date — is what makes a file a blog post: Hwaro auto-stamps date on every hwaro new page, so "has a date" alone misclassified ordinary pages (about.md, deep section pages) as posts.

Instance methods

run(options : Config::Options::ExportOptions) : ExportResult
Source