Embedding partials in markdown using a shortcode

Sometimes you wish to add a partial content within a Markdown file, unfortunately this is not possible by default. But wish your tears away - here we show you a workaround to make partials accessible within your markdown.

For whatever reason your project needs to support a solution like this. Here we come with the workaround:


The architecture is pretty easy. First, we will create a shortcode called partial and since there is a way to access the real partial within the shortcode we will open the partial within the shortcode.


Let’s create the following file:


{{ partial (.Get 0) }}


Usage Example


title = "Some basic Sample content"

# Embedding a partial.
In this article we will embedd conten from a partial.
{{< partial "partial-name" >}}

Lorem ipsum dolor.