gourlhugostatic-sitejamstack

How do I change the default url "/posts/" routing in a Hugo site?


I have created a new Hugo project. By default the urls route to mysite.com/posts/my-first-post. However I'm deploying to an existing domain where the url path for the posts is mysite.com/blog/my-first-post. How can I configure Hugo to go to /blog instead of /posts when view individual blog posts?

I've tried adding:

[permalinks]
    post = "/blog/:slug"

To my config.toml file and then running hugo server --disableFastRender so it looks for changes and restarted server but I haven't been able to change the url structure. How might I go about doing this? Currently running anake theme.


Solution

  • Shoulda been posts instead of post.

    config.toml

    baseURL = "https://connorleech.info/"
    languageCode = "en-us"
    title = "Connor Leech"
    theme = "ananke"
    [permalinks]
      posts = "blog/:title"