# Shortcode in HTML file which is located in content

**URL:** <https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639>\
**Category:** tips & tricks\
**Created:** [October 2, 2017, 11:55am UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639 "2017-10-02T11:55:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)\
**Post date:** [October 2, 2017, 11:55am UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639/1 "2017-10-02T11:55:16Z")

</div>

Just found out the following:

Beside some Markdown files I have an HTML file in my content which by default uses the template `layouts/_default/single.html`. I tried to put a partial directly in the HTML file (like `{{ partial "partial-name" . }}` which did not work. But then I tried to call a shortcode in the HTML file (like `{{< shortcode-name >}}` and call the same partial like above inside the shortcode and that works.

Nice. Perhaps this is something for you.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [October 2, 2017, 8:10pm UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639/2 "2017-10-02T20:10:23Z")

</div>

I always appreciate sharing workarounds, thanks!

I’d like to point out this may not be the first step to “fixing” this issue. If your partial isn’t working in a template, it is better in the long run to know why, ne? This sounds like it could be a scoping issue or something. Feel free to open a support ticket with this specific issue, I bet we could figure it out. 🙂

---

<div class="post-metadata">

**Author:** ![Leo\_Merkel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/leo_merkel/32/3321_2.png) [@Leo\_Merkel](https://discourse.gohugo.io/u/Leo_Merkel)\
**Post date:** [October 3, 2017, 10:15pm UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639/3 "2017-10-03T22:15:50Z")

</div>

I was not talking about a partial in a template. I was talking about a partial in an ordinary HTML file which lives in the content folder beside some Markdown files.

---

<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:** [October 3, 2017, 10:34pm UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639/4 "2017-10-03T22:34:07Z")

</div>

The gist of this is that

- HTML files in /content IS a content file. Shortcode support and all.
- If it has front matter, it will get the same template handling logic as the rest.
- If it does not have front matter, it will be its own template.

The last one is a little magical, but we have had it so long so removing it would break glass houses.

---

<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:** [October 10, 2017, 8:57pm UTC](https://discourse.gohugo.io/t/shortcode-in-html-file-which-is-located-in-content/8639/5 "2017-10-10T20:57:55Z")

</div>

So that last one… would that be good for landing pages? or not recommended?
