# Front matter best practice?

**URL:** <https://talk.commonmark.org/t/front-matter-best-practice/2235>\
**Category:** Extensions\
**Created:** [September 22, 2016, 3:16am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235 "2016-09-22T03:16:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaihendry](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/kaihendry/32/797_2.png) [@kaihendry](https://talk.commonmark.org/u/kaihendry)\
**Post date:** [September 22, 2016, 3:16am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235/1 "2016-09-22T03:16:19Z")

</div>

Hi, I scanned [http://spec.commonmark.org/0.26/](http://spec.commonmark.org/0.26/) & [https://talk.commonmark.org/search?q=front%20matter](https://talk.commonmark.org/search?q=front%20matter) and I’m none the wiser.

I need some markup in my Markdown to denote the HTML title for a simple golang static site generator we have at work.

I wrote something crappy a year ago that uses `[[!meta key="value"]]` which I might re-use: [https://github.com/kaihendry/blog/blob/master/meta.go](https://github.com/kaihendry/blog/blob/master/meta.go)

If there is a simpler way of doing it, I’m keen to learn how!

Cheers!

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [September 22, 2016, 9:32am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235/2 "2016-09-22T09:32:32Z")

</div>

I have moved this topic to “Extensions” since front matter is not amongst [the planned features for 1.0](https://talk.commonmark.org/t/issues-we-must-resolve-before-1-0-release-8-remaining/1287).

There have been some discussions regarding Jekyll style front matter blocks, along with other approaches. See the topics listed under “Meta Data” in the [list of proposed extensions](https://github.com/jgm/CommonMark/wiki/Proposed-Extensions).

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [September 23, 2016, 8:43am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235/3 "2016-09-23T08:43:06Z")

</div>

Front matter is not going to be part of the spec. An application that uses CommonMark can employ its own conventions for extracting lines from the front of the document and parsing them as front matter. In general, the needs will be different for different applications.

If you want something that works out of the box, try my [https://github.com/jgm/lcmark](https://github.com/jgm/lcmark), which allows YAML front matter and has a templating system.

---

<div class="post-metadata">

**Author:** ![kaihendry](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/kaihendry/32/797_2.png) [@kaihendry](https://talk.commonmark.org/u/kaihendry)\
**Post date:** [September 26, 2016, 4:22am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235/4 "2016-09-26T04:22:06Z")

</div>

Isn’t it worth noting that front matter other than HTML meta tags like `<meta name="description" content="Lorem Ipsum">` would need careful filtering?

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [September 27, 2016, 9:01am UTC](https://talk.commonmark.org/t/front-matter-best-practice/2235/5 "2016-09-27T09:01:00Z")

</div>

Yes, precisely. If your application supports front matter, it must strip this off, interpret it, and pass the rest to the CommonMark parser.
