# Using .Site.GetPage and Pagebundles together

**URL:** <https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956>\
**Category:** support\
**Created:** [June 7, 2022, 8:15am UTC](https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956 "2022-06-07T08:15:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![new\_to\_hugo](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@new\_to\_hugo](https://discourse.gohugo.io/u/new_to_hugo)\
**Post date:** [June 7, 2022, 8:15am UTC](https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956/1 "2022-06-07T08:15:01Z")

</div>

Hi,

I am trying to use pagebundles inside index.html file as follows:

```auto
{{with .Site.GetPage "/home" }}
  {{ with .GetPage "index.md" }}
    {{ .Content }}
  {{ end }}
{{ end }}

```

where the `home` directory is a leaf bundle present inside the `content` directory. However, I am unable to display the contents of the `index.md` file.

Can someone please help me ? I am unable to figure out what the problem is.

---

<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:** [June 7, 2022, 8:22am UTC](https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956/2 "2022-06-07T08:22:23Z")

</div>

> [@new\_to\_hugo](#):
>
> So the `home` directory is a page ? Interesting. Why is this the case ?

Because you chose it to be.

Note that this is a little bit unortodox.

Most people keep the home page as the root, e.g:

```bash
content
├── _index.md
└── posts
    ├── post1
    │ └── index.md
    └── post2
        └── index.md

```

You can then get the home page

```auto
site.GetPage "/"
# Shortcut
site.Home

```

---

<div class="post-metadata">

**Author:** ![new\_to\_hugo](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@new\_to\_hugo](https://discourse.gohugo.io/u/new_to_hugo)\
**Post date:** [June 7, 2022, 8:26am UTC](https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956/3 "2022-06-07T08:26:53Z")

</div>

So the `home` directory is a page ? Interesting. Why is this the case ? ~~Btw, following your suggestion, I still can’t seem to show the contents of `index.md`~~.

Edit: I believe there should be a `/` before `home`. It works now with the `/`.

---

<div class="post-metadata">

**Author:** ![new\_to\_hugo](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@new\_to\_hugo](https://discourse.gohugo.io/u/new_to_hugo)\
**Post date:** [June 7, 2022, 8:42am UTC](https://discourse.gohugo.io/t/using-site-getpage-and-pagebundles-together/38956/4 "2022-06-07T08:42:31Z")

</div>

This makes more sense to me now. Thank you 🙂 I’ll try adding some resources using

```auto
{{ with .Resources.GetMatch "img.png" }}
  <img src="data:{{ .MediaType }};base64,{{ .Content | base64Encode }}">
{{ end }}

```

for example and see how it goes.
