# Double URL from Page Bundle

**URL:** <https://discourse.gohugo.io/t/double-url-from-page-bundle/14814>\
**Category:** support\
**Created:** [October 20, 2018, 10:47pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814 "2018-10-20T22:47:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![storrgie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/storrgie/32/7060_2.png) [@storrgie](https://discourse.gohugo.io/u/storrgie)\
**Post date:** [October 20, 2018, 10:47pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/1 "2018-10-20T22:47:28Z")

</div>

Might be doing this wrong, but I’ve made a page bundle that looks like this:

```auto
[agd@clavain content]$ tree 
.
├── about
│ └── _index.md
└── posts
    ├── from-ghost-to-hugo.md
    ├── planning-iceland-scotland-england
    │ ├── google-calendar.png
    │ ├── google-my-maps.jpg
    │ └── index.md

```

the post for “planning iceland scotland england” makes it into my list, however the URL for this page is a doubled up version of the slug, for example: `/posts/planning-iceland-scotland-england/planning-iceland-scotland-england/`, however if I rename `index.md` to `_index.md` the post won’t show up in my list.

I suspect I might be doing something wrong in my list enumeration of posts? If so, here is that from my template:

```auto
{{ define "main" }}
	<main class="content" role="main">
		<div class="container">
			{{ range .Paginator.Pages }}
				<article class="li {{ .Type }}">
				    <header class="post-header">
		        		<h3 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
		        		<p class="post-time"><time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}">{{ .Date.Format "January 2, 2006" }}</time></p>
		    		</header>
		    		<section class="post-excerpt">
		       			<p>{{ .Description }}</p>
		    		</section>
		    		<footer class="post-footer">
				        <span>
				        	&nbsp;&nbsp;<i class="fa fa-tag"></i>
							{{ range .Params.tags }}
							<a href="/tags/{{ . | urlize }}">{{ . }}</a>
							{{ end }}
				        </span>
		    		</footer>
		    	</article>
			{{ end }}
		</div>
	</main>
{{ end }}

```

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [October 21, 2018, 12:53am UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/2 "2018-10-21T00:53:36Z")

</div>

In your `config.toml` what is your setting for post permalinks?

Also, what does the front matter look like for `index.md`?

---

<div class="post-metadata">

**Author:** ![storrgie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/storrgie/32/7060_2.png) [@storrgie](https://discourse.gohugo.io/u/storrgie)\
**Post date:** [October 21, 2018, 3:25am UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/3 "2018-10-21T03:25:30Z")

</div>

I dont have anything in my `config.toml` for post permalinks (should I add something?)

```auto
---
title : "Planning Iceland, Scotland, England"
slug: "planning-iceland-scotland-england"
date : 2017-02-12T18:31:42-04:00
draft : false
tags :
- travel
---

```

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [October 21, 2018, 3:31am UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/4 "2018-10-21T03:31:56Z")

</div>

> [@storrgie](#):
>
> I dont have anything in my `config.toml` for post permalinks (should I add something?)

Nope, was just wondering if you had that set.

What does the URL look like if you temporarily remove the slug from the front matter?

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [October 21, 2018, 3:40am UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/5 "2018-10-21T03:40:48Z")

</div>

Also, what happens if you add this to your `config.yaml`?

```auto
permalinks:
  post: /posts/:slug/

```

(Or if you use a `config.toml` try this)

```auto
[permalinks]
  post = "/posts/:slug/“

```

---

<div class="post-metadata">

**Author:** ![storrgie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/storrgie/32/7060_2.png) [@storrgie](https://discourse.gohugo.io/u/storrgie)\
**Post date:** [October 21, 2018, 1:06pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/6 "2018-10-21T13:06:16Z")

</div>

```auto
[permalinks]
  post = "/posts/:slug/“

```

Adding the above to the config doesn’t seem to change the behavior. However removing the slug entirely does eliminate the double URL. I’d like to keep a slug in the front matter though…

---

<div class="post-metadata">

**Author:** ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)\
**Post date:** [October 21, 2018, 2:44pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/7 "2018-10-21T14:44:57Z")

</div>

One small change, try `posts` instead of `post`

```auto
[permalinks]
  posts = "/posts/:slug/“

```

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [October 21, 2018, 6:26pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/8 "2018-10-21T18:26:29Z")

</div>

Your code and settings are fine.

There is currently an opened [issue](https://github.com/gohugoio/hugo/issues/4870) about the `slug` being appended to the directory name of the Leaf Bundle.

If you remove this redundant (here) slug from the Front Matter, your URL will be fine.  
I understand the slug often matters, in any case it did for me when I opened this issue.

---

<div class="post-metadata">

**Author:** ![storrgie](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/storrgie/32/7060_2.png) [@storrgie](https://discourse.gohugo.io/u/storrgie)\
**Post date:** [October 21, 2018, 6:47pm UTC](https://discourse.gohugo.io/t/double-url-from-page-bundle/14814/9 "2018-10-21T18:47:16Z")

</div>

Ah thank you! I’ll subscribe to the bug and follow!
