# Gallery shortcode not working

**URL:** <https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117>\
**Category:** Uncategorized\
**Created:** [December 21, 2020, 4:34am UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117 "2020-12-21T04:34:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thedivtagguy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/thedivtagguy/32/13045_2.png) [@thedivtagguy](https://discourse.gohugo.io/u/thedivtagguy)\
**Post date:** [December 21, 2020, 4:34am UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/1 "2020-12-21T04:34:48Z")

</div>

I’m trying to incorporate [this gallery shortcode theme into my website](https://github.com/mfg92/hugo-shortcode-gallery). I’ve followed the instructions as they stand.

I’ve edited my `config.yaml` to this:

```auto
theme: 
    - hugo-theme-novela
    - hugo-shortcode-gallery
baseURL: "https://example.com"
languageCode: "en-us"

```

I’ve also cloned it into the `themes` folder. According to the installation instructions, this should be enough to get me started. However when I add a new folder called `images` next to the `_index.md` inside content and us this shortcode, nothing shows up:

```auto
---
hero:
  heading: A Whole Sort of General Mishmash
  maxWidthPX: 400
seo:
  image: /images/hero-2.jpg
---
{{< gallery match="images/*" sortOrder="desc" rowHeight="150" margins="5" resizeOptions="600x300 q90 Lanczos" showExif="true" previewType="blur" embedPreview="true" >}}

```

I’ve uploaded all the files to this repo here if that helps: [Website Repo](https://github.com/thedivtagguy/website). Can someone help me with this? I’ve been trying for a while now. I’m new to Hugo so I might be missing something that is very simple.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [December 21, 2020, 9:51am UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/2 "2020-12-21T09:51:38Z")

</div>

Page resources for `_index.md` need to live in the same directory as the `_index.md`, i.e. not in a subdir: [https://gohugo.io/content-management/page-bundles/](https://gohugo.io/content-management/page-bundles/)

---

<div class="post-metadata">

**Author:** ![thedivtagguy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/thedivtagguy/32/13045_2.png) [@thedivtagguy](https://discourse.gohugo.io/u/thedivtagguy)\
**Post date:** [December 21, 2020, 6:49pm UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/3 "2020-12-21T18:49:44Z")

</div>

Based on what you said, I’ve shifted the images into the `content` folder and not in a subdir within:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/b/b1f3371b8abdfc6394ca496ed89ce8c9942ea5d1.png)

What should the shortcode be changed to? This is what I did:

```auto
{{< gallery match="/*" showExif="true" sortOrder="desc" loadJQuery="true" embedPreview="true" filterOptions="[{label: 'All', tags: '.'}, {label: 'Amphibian', tags: 'animal|amphibian'}]">}}

```

I’m pasting this shortcode inside the `_index.md`, that is correct right? I shouldn’t be placing it inside the `layouts` or something?

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [December 22, 2020, 5:38am UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/4 "2020-12-22T05:38:03Z")

</div>

Yes, you should be using the shortcode inside a content file.

> [@thedivtagguy](#):
>
> folder called `images` next to the `_index.md` inside content and us this shortcode

If you mean that you are using your shortcode inside `content/_index.md`: your theme’s `layouts/index.html` does not render `{{ .Content }}`, so it never parses the shortcode.

* * *

The shortcode looks fairly complex. You may want to ask the maintainer for help on how to use their component.

---

<div class="post-metadata">

**Author:** ![thedivtagguy](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/thedivtagguy/32/13045_2.png) [@thedivtagguy](https://discourse.gohugo.io/u/thedivtagguy)\
**Post date:** [December 22, 2020, 1:26pm UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/5 "2020-12-22T13:26:39Z")

</div>

> If you mean that you are using your shortcode inside `content/_index.md` : your theme’s `layouts/index.html` does not render `{{ .Content }}` , so it never parses the shortcode.

This was it! Thank you again.

---

<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:** [December 24, 2020, 1:26pm UTC](https://discourse.gohugo.io/t/gallery-shortcode-not-working/30117/6 "2020-12-24T13:26:39Z")

</div>

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