# Leaf Bundle: custom slug appended to bundle directory name

**URL:** <https://discourse.gohugo.io/t/leaf-bundle-custom-slug-appended-to-bundle-directory-name/12571>\
**Category:** support\
**Created:** [June 22, 2018, 5:47pm UTC](https://discourse.gohugo.io/t/leaf-bundle-custom-slug-appended-to-bundle-directory-name/12571 "2018-06-22T17:47:16Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [June 22, 2018, 5:47pm UTC](https://discourse.gohugo.io/t/leaf-bundle-custom-slug-appended-to-bundle-directory-name/12571/1 "2018-06-22T17:47:16Z")

</div>

Hi there,

I’m toying around with the usage of custom slug in a Leaf Bundle.

It appears the custom slug is appended to the Leaf Bundle directory name.  
Consider this:

```auto
# from about/services/misc.md
---
Title: What we do
slug: what-we-do/

```

The page will live at **`/about/services/what-we-do/`** which is what we want.

Now, if I use a Page Bundle

```auto
# from about/services/misc/index.md
---
Title: What we do
slug: what-we-do/

```

Then, the page will live at **`/about/services/misc/what-we-do/`** which is, for my part, not what I want. I want it to live at `/about/services/what-we-do/` just like before switching to a bundle.

This can be solved by adding a custom url, but this is rather tedious, especially when you have to include the language code in there.

Speaking of languages, this becomes problematic when you use different content dir per language, and need to maintain translation files pairing while enforcing localized url. That’s when you will almost systematically need a custom slug.

Am I missing something on the usage of custom slugs? Forgive me if it’s already been discused, but I was not able to find anything in the discourse or the github issues.

cc @kaushalmodi, maybe you know what I’m doing wrong 🙂

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [June 22, 2018, 5:57pm UTC](https://discourse.gohugo.io/t/leaf-bundle-custom-slug-appended-to-bundle-directory-name/12571/2 "2018-06-22T17:57:08Z")

</div>

> [@regis](#):
>
> maybe you know what I’m doing wrong

Hello! That definitely looks like a bug.

I don’t use slugs so I never came across this. I just set the permalinks to be the filenames (it will be the folder name containing the `index.md` in the case of leaf bundles):

```toml
[Permalinks]
  posts = "/:filename/"
  notes = "/notes/:filename/"

```

---

<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:** [June 22, 2018, 6:07pm UTC](https://discourse.gohugo.io/t/leaf-bundle-custom-slug-appended-to-bundle-directory-name/12571/3 "2018-06-22T18:07:47Z")

</div>

Thanks! [https://github.com/gohugoio/hugo/issues/4870](https://github.com/gohugoio/hugo/issues/4870)
