# How to serve blogposts taxonomy from root directory instead of /posts

**URL:** <https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381>\
**Category:** support\
**Created:** [January 11, 2023, 12:46am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381 "2023-01-11T00:46:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 12:46am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/1 "2023-01-11T00:46:58Z")

</div>

I’m listing my blog entries on my home page. I’d like to have article.md appear on my site as [ryanwwest.com/article/](http://ryanwwest.com/article/), not [ryanwwest.com/posts/article/](http://ryanwwest.com/posts/article/) ( I want to essentially replace the homepage with /posts then eliminate /posts). I’ve been able to list my content on the homepage with some changes in `layouts/partials` and by placing all my blog markdown directly into `content/`.

While the blog entries render and are served, they don’t show tag, date information anymore (and I assume Giscus will also not work when I add it). Does anyone know how I can fix this?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 11, 2023, 12:55am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/2 "2023-01-11T00:55:21Z")

</div>

> [@ryanwwest](#):
>
> I’d like to have article.md appear on my site as `ryanwwest.com/article/` not `ryanwwest.com/posts/article/`.

Add a `permalinks` setting in your site configuration:  
[https://gohugo.io/content-management/urls/#permalinks](https://gohugo.io/content-management/urls/#permalinks)

> [@ryanwwest](#):
>
> While the blog entries render and are served, they don’t show tag, date information anymore (and I assume Giscus will also not work when I add it). Does anyone know how I can fix this?

I think we would need to the project repository.

---

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 1:12am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/3 "2023-01-11T01:12:19Z")

</div>

Thanks, I tried adding this to my config.toml by adding

```auto
[permalinks]
posts = '/'

```

I didn’t notice an effect but I’m guessing that’s because I already modified the partials to display list.html instead of home.html, so I my list of articles there to begin with.

> I think we would need to the project repository.

Not sure if I understood you; are you saying this (serving taxonomy information on blog posts from the root folder) isn’t currently supported by Hugo?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 11, 2023, 1:14am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/4 "2023-01-11T01:14:54Z")

</div>

I just edited your post, surrounding code/config with three backticks. Does this now match your site config?

---

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 1:16am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/5 "2023-01-11T01:16:54Z")

</div>

That was confusing, sorry. Yes, that’s exactly how it is.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 11, 2023, 1:20am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/6 "2023-01-11T01:20:06Z")

</div>

> [@ryanwwest](#):
>
> That was confusing

Use markdown when posting here, just like you were writing a post for a Hugo site.

> [@ryanwwest](#):
>
> I didn’t notice an effect

You need to do this, like the examples in the documentation:

```plaintext
[permalinks]
posts = '/:slug/'

```

> [@ryanwwest](#):
>
> are you saying this (serving taxonomy information on blog posts from the root folder) isn’t currently supported by Hugo

No. What I am saying is that it is difficult to answer your question without seeing your site structure, templates, etc.

See [https://discourse.gohugo.io/t/requesting-help/9132](https://discourse.gohugo.io/t/requesting-help/9132).

> Let us see your code
> 
> Include a **link to the source code repository** of your project, because we really need the _context_ of seeing your templates and partials to be able to help you. It is trivial to do a quick `git clone` on your repo, then run `hugo server` in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you _can_ share, which reproduces the problem you’re experiencing.

---

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 1:31am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/7 "2023-01-11T01:31:54Z")

</div>

Sounds good and thanks: [GitHub - ryanwwest/website at v4](https://github.com/ryanwwest/website/tree/v4). (use branch v4 and the `themes/rytheme` directory is now irrelevant). I appreciate your help.

---

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 1:36am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/8 "2023-01-11T01:36:47Z")

</div>

I’m not sure if the `themes/hugo-coder` directory will show up properly there since it’s a submodule. If not, it is at [GitHub - ryanwwest/hugo-coder: A minimalist blog theme for hugo.](https://github.com/ryanwwest/hugo-coder).

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 11, 2023, 1:55am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/9 "2023-01-11T01:55:18Z")

</div>

1) The content directory does not contain a posts directory. So I’m not sure what you want.

2) You should consider creating a .gitignore file for:

- public/
- node\_modules/

3) In your site configuration:

- The `baseURL` should be that of your live site (e.g., `https://example.org/`). Note the trailing slash.
- There is rarely a good reason to set `relativeurls = true`
- Replace the `pygments` settings with the relevant settings from the [documentation](https://gohugo.io/getting-started/configuration-markup/#highlight), though the defaults are fine in most cases. We haven’t used pygments in many years.

---

<div class="post-metadata">

**Author:** ![ryanwwest](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ryanwwest/32/18584_2.png) [@ryanwwest](https://discourse.gohugo.io/u/ryanwwest)\
**Post date:** [January 11, 2023, 2:02am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/10 "2023-01-11T02:02:49Z")

</div>

> The content directory does not contain a posts directory

Thanks, this was my problem. I removed it in an earlier effort to get posts to be displayed, but without the permalink it wasn’t the right way to go. Now it is working.

And thanks for the other helpful advice, I’ll work on implementing it. With regards to `baseURL`, the reason I use it is to develop locally and on a remote private server I own via Tailscale (and also host the site on my public hosting box), and have the site work on all three - when I’ve put my full site name there, it begins loading remote content from the public version of my site on my local instance.

---

<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:** [January 13, 2023, 2:03am UTC](https://discourse.gohugo.io/t/how-to-serve-blogposts-taxonomy-from-root-directory-instead-of-posts/42381/11 "2023-01-13T02:03:20Z")

</div>

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