# Using shortcodes in html content

**URL:** https://discourse.gohugo.io/t/using-shortcodes-in-html-content/2960
**Category:** support
**Created:** [March 21, 2016, 4:00pm UTC](https://discourse.gohugo.io/t/using-shortcodes-in-html-content/2960 "2016-03-21T16:00:32Z")
**Posts on this page:** 1
**Showing post:** 5

<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: [March 22, 2016, 11:58am UTC](https://discourse.gohugo.io/t/using-shortcodes-in-html-content/2960/5 "2016-03-22T11:58:26Z")

</div>

> [@coldgrnd](#):
>
> my initial try was to use the shortcode directly in the index.html file but this seems not to be possible and I get an exception like:template: theme/index.html:6: unexpected “\<” in command

No, that doesn’t work; shortcodes are for content files (but there is nothing you cannot do in a template file that a shortcode file can).

What you can do, if all you want is a HTML file and do not need markdown content etc., you can do put the html directly into /content, so /content/test.html:

```auto
<html>
<h1>Test</h1>

{{< foo >}}
</html>

```

Will work and accessible at [http://localhost:1313/test/](http://localhost:1313/test/) or [http://localhost:1313/test.html](http://localhost:1313/test.html) if uglyUrls.

This is a somewhat hidden feature in Hugo.

As to reading the “example.cpp”, see [https://github.com/spf13/hugo/pull/2008](https://github.com/spf13/hugo/pull/2008)

I will probably wrap that up later today.

---

_[View the full topic](https://discourse.gohugo.io/t/using-shortcodes-in-html-content/2960)._
