# How to get the markdownified content in single.md to have custom output markdown

**URL:** <https://discourse.gohugo.io/t/how-to-get-the-markdownified-content-in-single-md-to-have-custom-output-markdown/39846>\
**Category:** support\
**Created:** [August 5, 2022, 2:55pm UTC](https://discourse.gohugo.io/t/how-to-get-the-markdownified-content-in-single-md-to-have-custom-output-markdown/39846 "2022-08-05T14:55:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juh2](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/juh2/32/3980_2.png) [@juh2](https://discourse.gohugo.io/u/juh2)\
**Post date:** [August 5, 2022, 2:55pm UTC](https://discourse.gohugo.io/t/how-to-get-the-markdownified-content-in-single-md-to-have-custom-output-markdown/39846/1 "2022-08-05T14:55:45Z")

</div>

To get a markdown file as custom output format I created a template single.md with this content:

```auto

# {{ .Title }}

{{. Content }}

```

The resulting markdown file has html code.

When I use `{{ .RawContent }}` I get the raw content from the original markdown file with shortcodes etc.

I would like get a markdown file with resolved shortcodes.

Is this possible?

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [August 5, 2022, 3:01pm UTC](https://discourse.gohugo.io/t/how-to-get-the-markdownified-content-in-single-md-to-have-custom-output-markdown/39846/2 "2022-08-05T15:01:54Z")

</div>

There has been discussion about this on Github, but nothing yet. Basically a `.RenderedContent` type of object. But it doesn’t exist now.

> <https://github.com/gohugoio/hugo/issues/7297>
>
> I have been hit by this issue twice recently -- so I assume this is a problem wo…rth solving (I know there are similar issue, and this also relates to \`.RenderString\`.
> 
> Currently we have:
> 
> \* \`.Content\` which gives rendered HTML with shortcodes rendered.
> \* \`.RawContent\` which gives the raw source excluding front matter. No shortcodes rendered.
> 
> A common pattern is to include files using \`.GetPage\` via a shortcode, e.g.:
> 
> \`\`\`md
> 
> \# Title
> 
> {{\< include "foo.md" \>}}
> 
> \`\`\`
> 
> Using the \`{{\<\` means you can include just about anything and it will be preserved as-is. But it will not partake in the global rendering context re. table of contents, foot notes etc.
> 
> You can do this in your shortcode:
> 
> \`\`\`html
> {{ (site.GetPage "foo.md").RawContent n}}
> \`\`\`
> 
> And then
> 
> \`\`\`md
> 
> \# Title
> 
> {{% include "foo.md" %}}
> 
> \`\`\`
> 
> The above will work but any shortcodes in \`foo.md\` will not be rendered.
> 
> Which this issue is all about.
> 
> I assume that it makes sense that \`.RenderString\` uses this method internally by default, but what I need is basically:
> 
> \`\`\`html
> {{ $markdownWithRenderedShortcodes := .RawContent | .RenderShortcodes }}
> \`\`\`
> 
> These should also work:
> 
> \`\`\`html
> {{ $markdownWithRenderedShortcodes := .RenderShortcodes }}
> {{ $markdownWithRenderedShortcodes := "string with shortcodes" | .RenderShortcodes }}
> \`\`\`
> 
> /cc @regisphilibert @onedrawingperday @digitalcraftsman @moorereason and gang
> 
> And yes, this is tightly connected to a \`Page\` so I think a method makes sense.

---

<div class="post-metadata">

**Author:** ![gaetawoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/gaetawoo/32/16789_2.png) [@gaetawoo](https://discourse.gohugo.io/u/gaetawoo)\
**Post date:** [August 5, 2022, 3:03pm UTC](https://discourse.gohugo.io/t/how-to-get-the-markdownified-content-in-single-md-to-have-custom-output-markdown/39846/3 "2022-08-05T15:03:09Z")

</div>

Also discussed here:

> [@Export to markdown with shortcodes](https://discourse.gohugo.io/t/export-to-markdown-with-shortcodes/39590):
>
> I am trying to parse a markdown and export it as markdown with the shortcode rendered. Is this possible with Hugo. I have tried .RawContent, markdownify, .Content, .Plain etc.
