# Renaming content subdir makes \`Serve\` stop working?

**URL:** <https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398>\
**Category:** Support\
**Created:** [July 18, 2022, 11:03pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398 "2022-07-18T23:03:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moffwings](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/moffwings/32/798_2.png) [@moffwings](https://zola.discourse.group/u/moffwings)\
**Post date:** [July 18, 2022, 11:03pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/1 "2022-07-18T23:03:07Z")

</div>

I have a `/content/loose_stuff` directory in my Zola project that I want to `mv loose_stuff/ posts/` but when I do so, `zola serve` stops working? I can fix it by just `mv posts/ loose_stuff/` but I don’t want a loose\_stuff directory hanging around permanently in my zola site.

I’ve tried:

- reading over all my template and content files for any hardcoded links to loose\_stuff but haven’t found any.
- running `zola check`
- `zola build` also stops working

Using Zola version 0.16.0  
The terminal output says

```auto
Error: Failed to serve the site
Error: Failed to render page '/home/moffwings/Desktop/Projects/zola-site/content/home.md'
Error: Reason: Failed to render 'page.html' (error happened in a parent template)
Error: Reason: Function call 'get_url' failed
Error: Reason: `get_url`: could not resolve URL for link `@/loose_stuff/_index.md` not found.

```

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 19, 2022, 6:03am UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/2 "2022-07-19T06:03:16Z")

</div>

Is a restart of `zola serve` working? In theory it should reload everything on changes but who knows

---

<div class="post-metadata">

**Author:** ![moffwings](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/moffwings/32/798_2.png) [@moffwings](https://zola.discourse.group/u/moffwings)\
**Post date:** [July 19, 2022, 7:35pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/3 "2022-07-19T19:35:52Z")

</div>

The problem persists through restarting `zola serve` and restarting my computer unfortunately.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 19, 2022, 10:12pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/4 "2022-07-19T22:12:04Z")

</div>

Can you paste a `tree` output of the content dir? I’m not sure i’m getting it then

---

<div class="post-metadata">

**Author:** ![moffwings](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/moffwings/32/798_2.png) [@moffwings](https://zola.discourse.group/u/moffwings)\
**Post date:** [July 20, 2022, 12:09am UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/5 "2022-07-20T00:09:40Z")

</div>

running `tree` from content dir

```auto
.
├── home.md
├── _index.md
└── posts
    ├── about zola.md
    ├── buffer.md
    └── _index.md

```

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 20, 2022, 4:29pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/6 "2022-07-20T16:29:29Z")

</div>

> [@moffwings](#):
>
> `@/loose_stuff/_index.md`

Well there’s no loose\_stuff in that directory so that normal. In that case, you need to change your template to refer to `@/posts/_index.md`

---

<div class="post-metadata">

**Author:** ![moffwings](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/moffwings/32/798_2.png) [@moffwings](https://zola.discourse.group/u/moffwings)\
**Post date:** [July 20, 2022, 10:40pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/7 "2022-07-20T22:40:29Z")

</div>

Oof, I figured out what happened: It’s easy to miss hardcoded links to stuff like `loose_stuff` when you only manually look over your code.

Something that helped me is using a search tool like `rg` (ripgrep) with `rg loose_stuff` to find that I **did** have a hardcoded path to fix. 🥴

---

<div class="post-metadata">

**Author:** ![ashish](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@ashish](https://zola.discourse.group/u/ashish)\
**Post date:** [March 22, 2024, 5:28pm UTC](https://zola.discourse.group/t/renaming-content-subdir-makes-serve-stop-working/1398/8 "2024-03-22T17:28:04Z")

</div>

Created a login and joined to upvote this comment. “ripgrep” really helped to find out the loose end.

Used “relative paths” to images and “index.md” files instead of “@”, and things are working for me.

Thanks!
