# YAML front matter support

**URL:** <https://discuss.write.as/t/yaml-front-matter-support/3039>\
**Category:** Development\
**Created:** [June 24, 2021, 3:05pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039 "2021-06-24T15:05:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nolan](https://discuss.write.as/letter_avatar_proxy/v4/letter/n/aeb1de/32.png) [@nolan](https://discuss.write.as/u/nolan)\
**Post date:** [June 24, 2021, 3:05pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/1 "2021-06-24T15:05:15Z")

</div>

Hey folks,

Really like the simplicity of WriteFreely and am thinking of migrating my long-neglected personal blog to it. Being able to boost and interact with posts on the fediverse might be just what I need to encourage me to write more. There are a few features I’d like to see, though:

- Importing content more easily. I know RSS/feed imports were recently discussed, but I have piles of posts written for Hugo, and not all of them fit within a single feed page.
- Enclosures for podcasts. It’s fine if WriteFreely itself doesn’t do media storage, but I’d like to link to an Ogg or video hosted somewhere else and have it automatically included as an enclosure.
- Meta descriptions. I promote posts in places that display these prominently. AFAICT these can’t be added manually to posts right now.

Has thought been given to supporting these features with YAML front matter, as commonly found in static site generators? I’m thinking maybe build out some sort of standard schema, and optionally (de)serialize that into YAML front matter at the top of the editor? This would help in a few ways:

- I could probably paste Hugo Markdown posts directly into the editor, and have their metadata populated automatically. If I want to backdate a post without editing the date later, for example, I don’t see how I can do that currently.
- The schema and supported features could be iterated separately from the interface. There might be some way of making enclosure additions nicer–drag-and-drop a URL into the editor and be prompted to include it as an enclosure for instance–but for now just being able to do that via YAML would be a win.

I’m not particularly wedded to YAML; I’m only suggesting it because it’s what many other generators use. Thoughts? I might be willing to take a crack at implementing this if it’s a desired feature, though I don’t know Go terribly well ATM. Might be a good project to learn. 🙂

---

<div class="post-metadata">

**Author:** ![ulysses](https://discuss.write.as/user_avatar/discuss.write.as/ulysses/32/1157_2.png) [@ulysses](https://discuss.write.as/u/ulysses)\
**Post date:** [June 24, 2021, 5:21pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/2 "2021-06-24T17:21:54Z")

</div>

That’s [what I just thought of](https://discuss.write.as/t/would-writefreely-consider-supporting-yaml/3040)! This will greatly facilitate migration! If we also add links of image from the external map bed in the `MD` file, then the migration of the blog will be very easy!

I currently have hundreds of posts that need to be migrated from **other** blog platform to _WriteFreely_, but the thing that bothersme the most is that WriteFreely doesn’t support YAML. I believe that _write.as_ or _writeFreely_ will attract more people from other blog platforms if this feature is supported.

By the way, will WriteFreely support direct reading of MD files in the future? In that case, migration achieves maximum convenience.

---

<div class="post-metadata">

**Author:** ![angelo](https://discuss.write.as/user_avatar/discuss.write.as/angelo/32/884_2.png) [@angelo](https://discuss.write.as/u/angelo)\
**Post date:** [June 24, 2021, 6:09pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/3 "2021-06-24T18:09:38Z")

</div>

Hey @nolan, while this doesn’t quite address your feature requests, I recently wrote a Hugo-to-WriteFreely importer (and migrated my own old, long-neglected Hugo blog with it). Maybe it can serve as a jumping off point for you?

> **[writefreely/hugo-importer](https://github.com/writefreely/hugo-importer)**
>
> CLI tool for migrating Hugo content to Write.as/WriteFreely

---

<div class="post-metadata">

**Author:** ![ulysses](https://discuss.write.as/user_avatar/discuss.write.as/ulysses/32/1157_2.png) [@ulysses](https://discuss.write.as/u/ulysses)\
**Post date:** [June 24, 2021, 6:48pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/4 "2021-06-24T18:48:30Z")

</div>

Sounds great! Looking forward to it!

---

<div class="post-metadata">

**Author:** ![matt](https://discuss.write.as/user_avatar/discuss.write.as/matt/32/2760_2.png) [@matt](https://discuss.write.as/u/matt)\
**Post date:** [July 8, 2021, 5:20pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/5 "2021-07-08T17:20:59Z")

</div>

I _really_ like the idea of supporting YAML front matter as a way to set metadata in our text-based web editor. It’s a format that’s fairly well-known among static site generator users, would be pretty straightforward to implement, and fits well with our text-based ethos.

I can imagine the simplest implementation would merely parse this front matter (FM) on the client side (if it’s there) and send it to the API correctly upon publishing. This wouldn’t require any backend changes, and would make adding FM completely optional – which I think is crucial, from a product / UX perspective.

The only real issue I see coming from this would be when _editing_ a post. Users publishing FM might expect to see FM when they’re later editing their posts. But if we’re not distinguishing which posts were published with FM, we’d have no way to know whether to include it at the top of the post or not. We could either live with this, or create a new WriteFreely editor option that _always_ shows FM at the top of the post. In this case, when editing a post, we’d merely parse out the metadata and construct fresh FM at the top.

---

<div class="post-metadata">

**Author:** ![matt](https://discuss.write.as/user_avatar/discuss.write.as/matt/32/2760_2.png) [@matt](https://discuss.write.as/u/matt)\
**Post date:** [July 8, 2021, 5:26pm UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/6 "2021-07-08T17:26:58Z")

</div>

To your other feature requests:

> [@nolan](#):
>
> - Importing content more easily. I know RSS/feed imports were recently discussed, but I have piles of posts written for Hugo, and not all of them fit within a single feed page.

I’d echo @angelo and say the Hugo importer should work great for this. But otherwise, more import options are at the top of our priority list, after the manual migration projects we’re currently working on.

> [@nolan](#):
>
> - Enclosures for podcasts. It’s fine if WriteFreely itself doesn’t do media storage, but I’d like to link to an Ogg or video hosted somewhere else and have it automatically included as an enclosure.

I think we can definitely address this in the near future. We’ll continue the discussion on [your other thread](https://discuss.write.as/t/how-does-writefreely-handle-attachments-enclosures/2986).

> [@nolan](#):
>
> - Meta descriptions. I promote posts in places that display these prominently. AFAICT these can’t be added manually to posts right now.

I can definitely understand needing a bit more control over this. Would you mind starting a new topic for this feature in particular in the #Feedback > Feature requests category, so others can vote on it, too? I’m very open to adding support for this.

---

<div class="post-metadata">

**Author:** ![MarcoZehe](https://discuss.write.as/user_avatar/discuss.write.as/marcozehe/32/1403_2.png) [@MarcoZehe](https://discuss.write.as/u/MarcoZehe)\
**Post date:** [November 28, 2021, 11:43am UTC](https://discuss.write.as/t/yaml-front-matter-support/3039/7 "2021-11-28T11:43:45Z")

</div>

I, too, would like to see this added. I‘d like to convert my posts from two blogs to WriteFreely, and they are currently in a Jekyll/YAML style Markdown format and are the source for an Eleventy SSG setup. But in the long run, this is proving impractical, and I would like to migrate to Write.as.
