Remap a branch bundle to a different URL


I have posts under ./posts directory. I like /posts/ page very much, but I’d like it to be served at /.

I tried adding to ./posts, with url: /. It doesn’t work reliably (as if the outcome depends on the order individual pages are being rendered).

Another workaround I attempted was to create a custom layout file for the root page with the following code {{ with .GetPage “/posts” }}{{ .Render “list” }}{{ end }}. The catch though is that the theme I’m using renders canonical urls in pages, resulting in the root page telling that its canonical url is /posts.

Is there a better way to remap a branch bundle to a different URL?

You cannot have 2 different pages at one URL (running hugo --printPathWarnings should give you some insight).

It should be possible to turn off the home page (e.g. disableKinds = [ "home"]),

@bep Awesome! Works like a charm.

1 Like

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