Skip to content

Incomplete Handling of YAML Front Matter #856

@herzi

Description

@herzi

Short description

According to the doc-comment for Article.metadata, Ignite supports YAML front matter like Jekyll does. However, that's not true. Looking at the implementation of Article.processMetadata(for:) reveals that the handling is limited to dictionaries with single-line key-pairs with single values (read: neither dictionaries nor arrays are supported).

Steps to Reproduce

Create a file with the following front matter (which is valid YAML):

---
elements: ['fire']
avatars:
  - roku
  - szeto
---
# Markdown Content

Expected behavior

Accessing the properties elements or avatars return a arrays of strings: ["fire"] and ["roku", "szeto"] respectively.

Actual behavior

Accessing the property elements yields a single string: "[\'fire\']", the property avatars is not present in the list of keys of metadata.

Build information

  • OS: macOS 26.2 (25C56)
  • Editor: Xcode 26.2 (17C52)
  • Swift version: Apple Swift version 6.2.3
  • Ignite version: 0.6.0
  • Tested browsers: n/a (build issue)

Screenshots
n/a

Additional context

I think either of the following approaches is a useful one to allow for more structure in the front matter:

  1. Integrate a full YAML parser like Yams
  2. Allow API consumers of Ignite to provide a replacement implementation for YAML parsing (so e.g. my project can provide a more sophisticated one based on Yams)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions