I am creating a blog for my daughter and baring it on my other creation, but experienced strange behaviour here:
in config.toml I added
[permalinks]
tags = "/tag/:slug/"
categories = "/category/:slug/"
authors = "/author/:slug/"
So that link to the category will be like that /category/writing/
So Title of this page based on that:
<span>Posts in category {{.Title}}</span>
Will be
Posts in category Writing
However, noticed by accident that there is also a link /writing/
in the root directory that refers to almost that same page but with a different Title.
Posts in category Writings
Have a look at s
added to the category Writing
.
/category/writing/
> {{.Title}} = "Writing"
/writing/ >
{{.Title}} = “Writings”`
Why is that and how to get only a list of pages in the category with slug /category/ on the front, not both?
Ref to that behaviour I found here
The default behavior of Hugo is to pluralize list titles; hence the inflection of the quote section to “Quotes” when called with the .Title page variable. You can change this via the pluralizeListTitles directive in your site configuration.
ps.
I placed each post in a content folder in its folder that is based on the category name, hence this is why this is generated like that, however, how could I turn this off? possible?
As I read here
All content for your website will live inside this directory. Each top-level folder in Hugo is considered a content section. For example, if your site has three main sections—blog, articles, and tutorials—you will have three directories at content/blog, content/articles, and content/tutorials. Hugo uses sections to assign default content types.
Hence that planned behaviour.
Can this be disabled or add redirection to /category/
?
Similar behaviour I noticed on other sites when I put /posts/
into subfolder by date (but url for each post is based on the root directory, the sorting is mainly for my organisation of files).
I see link generated /posts/
which is almost a duplicate what’s on :root address so would prefer to redirect it to :root. When redirection is not an issue, would prefer to get this done automatically rather than generate redirection to each folder in /content/
directory if possible?