# Partial not evaluated (rendering the command instead)

**URL:** <https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175>\
**Category:** support\
**Created:** [March 22, 2020, 6:30pm UTC](https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175 "2020-03-22T18:30:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougwinsby](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dougwinsby/32/11259_2.png) [@dougwinsby](https://discourse.gohugo.io/u/dougwinsby)\
**Post date:** [March 22, 2020, 6:30pm UTC](https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175/1 "2020-03-22T18:30:16Z")

</div>

I want to use a **partial** to display team members in an `_index.html` (not the site homepage).

**/layouts/partials/coreteam.html:**

```
<div class="row justify-content-around">
  {{ range .Site.Data.team }}
  <figure>
    <img src="/images/{{ .image }}" alt="{{ .name }}" />
    <figcaption class="text-center">{{ .name }}</figcaption>
  </figure>
  {{end}}
</div>

```

I have a data file `/data/team.json` that looks like this:

```
[
  {
    "name": "Jim Smith",
    "image": "/images/avatar1.png"
  }
  ...
]

```

I include the partial like this (in /content/en/about/\_index.html):

```
<div class="container">
  {{ partial "coreteam.html" . }}
  <h2 class="text-center">Join us!</p>
</div>

```

When I preview the site with `hugo server`, it **shows the text of the call** instead of evaluating it:

**{{ partial “coreteam.html” . }}**

I tried using it in a `.md`, but with the same results.

I tried `{{< ... >}}, {{% ... %}}`, but those returned a Hugo error.

I’m sorry if this is a basic question, but I’m stumped.

**Environment:**  
GOOS=“windows”  
GOARCH=“amd64”  
GOVERSION="go1.14

**Theme:** [Docsy](https://github.com/google/docsy/)

Thank you for your help.

---

<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:** [March 22, 2020, 6:48pm UTC](https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175/2 "2020-03-22T18:48:58Z")

</div>

A partial is a reusable bit of code, used in templates: [https://gohugo.io/templates/partials/#readout](https://gohugo.io/templates/partials/#readout)

You want a shortcode, similar to a partial, but with special considerations for being included in content, as you are trying; partials don’t go in content files: [https://gohugo.io/templates/shortcode-templates/](https://gohugo.io/templates/shortcode-templates/)

Move your “partial” to `layouts/shotcodes` and rework your code accordingly. 🙂

---

<div class="post-metadata">

**Author:** ![dougwinsby](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/dougwinsby/32/11259_2.png) [@dougwinsby](https://discourse.gohugo.io/u/dougwinsby)\
**Post date:** [March 22, 2020, 7:14pm UTC](https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175/3 "2020-03-22T19:14:04Z")

</div>

So easy (once you pointed me in the right direction)… **Thank you!**

**Steps I took:**

1. Moved `coreteam.html` to `/layouts/shortcodes`
2. Changed incorrect partial call to `{{< coreteam >}}`
3. Removed `/index/` from json data file (duplicated in shortcode)

Thanks again for your quick response.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [March 24, 2020, 7:14pm UTC](https://discourse.gohugo.io/t/partial-not-evaluated-rendering-the-command-instead/24175/4 "2020-03-24T19:14:10Z")

</div>

Closed on March 24, 2020, 7:14pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
