# Markdown in front matter

**URL:** <https://discourse.gohugo.io/t/markdown-in-front-matter/1004>\
**Category:** support\
**Created:** [April 1, 2015, 10:54am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004 "2015-04-01T10:54:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mk12](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mk12/32/355_2.png) [@mk12](https://discourse.gohugo.io/u/mk12)\
**Post date:** [April 1, 2015, 10:54am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/1 "2015-04-01T10:54:45Z")

</div>

I was a bit surprised that none of the front matter is processed as Markdown. For example, if I have an apostrophe in the title or description, it gets rendered as a straight quote while all the apostrophes in the body text are correctly replaced with `’`. Am I missing something?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 1, 2015, 11:01am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/2 "2015-04-01T11:01:27Z")

</div>

You can use the `markdownify` template function, i.e.:

```
{{ .Params.description | markdownify }}
```

---

<div class="post-metadata">

**Author:** ![mk12](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mk12/32/355_2.png) [@mk12](https://discourse.gohugo.io/u/mk12)\
**Post date:** [April 1, 2015, 11:44am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/3 "2015-04-01T11:44:54Z")

</div>

Perfect! Thanks.

---

<div class="post-metadata">

**Author:** ![mk12](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/mk12/32/355_2.png) [@mk12](https://discourse.gohugo.io/u/mk12)\
**Post date:** [April 1, 2015, 12:06pm UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/4 "2015-04-01T12:06:48Z")

</div>

Is there a way to prevent `markdownify` from wrapping it in `<p>` tags? I could add a CSS rule to make them do nothing, but semantically it is incorrect.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 1, 2015, 1:09pm UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/5 "2015-04-01T13:09:51Z")

</div>

Currently no. The p tags are added by Blackfriday, but should be removed by Hugo … I guess this is a bug.

I created this:

> <https://github.com/gohugoio/hugo/issues/1025>
>
> See http://discuss.gohugo.io/t/markdown-in-front-matter/1004/2

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 1, 2015, 1:43pm UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/6 "2015-04-01T13:43:50Z")

</div>

This is now fixed in the latest Hugo source.

---

<div class="post-metadata">

**Author:** ![bguiz](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@bguiz](https://discourse.gohugo.io/u/bguiz)\
**Post date:** [April 7, 2015, 1:07am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/7 "2015-04-07T01:07:20Z")

</div>

Thanks @bjornerik

In your example, you use a Param containing markdown as a string. How would you do the same but with markdown from a file?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 7, 2015, 11:06am UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/8 "2015-04-07T11:06:57Z")

</div>

> **[Data Templates](http://gohugo.io/templates/data-templates/)**
>
> In addition to Hugo's built-in variables, you can specify your own custom data in templates or shortcodes that pull from both local and dynamic sources.

But note that the most common way to render markdown is via regular content (md) files; the above discusses how to get markdown support in template files.

---

<div class="post-metadata">

**Author:** ![alizain](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@alizain](https://discourse.gohugo.io/u/alizain)\
**Post date:** [February 15, 2017, 6:51pm UTC](https://discourse.gohugo.io/t/markdown-in-front-matter/1004/9 "2017-02-15T18:51:42Z")

</div>

Nope, this is not a bug! It’s standard behaviour for Markdown renderers. Please remove this. I’ve dissected the issue in detail on github.

> <https://github.com/gohugoio/hugo/issues/3040>
