If you want to have the same names for taxonomies but distinct taxonomy, how to do?
like:
/blog/category
/blog/tag
/project/tag
/publications/category
Thanks
If you want to have the same names for taxonomies but distinct taxonomy, how to do?
like:
/blog/category
/blog/tag
/project/tag
/publications/category
Thanks
content structure
content/
βββ books/
β βββ book-1.md
β βββ book-2.md
βββ films/
β βββ film-1.md
β βββ film-2.md
βββ _index.md
site config
[taxonomies]
'books/genre' = 'books/genres'
'films/genre' = 'films/genres'
front matter
+++
title = 'Book 1'
date = 2023-02-08T09:52:15-08:00
draft = false
'books/genres' = ['romance']
+++
Hi Joe,
What do you think about that:
content
content/
βββ books/
β βββ book-1.md
β βββ book-2.md
βββ films/
β βββ film-1.md
β βββ film-2.md
βββ genres/
β βββ romantic.md
β βββ horror.md
β βββ _index.md
βββ films_genres/
β βββ romantic.md
β βββ horror.md
β βββ _index.md
βββ _index.md
config
[taxonomies]
'genre' = 'genres'
'films_genre' = 'films_genres'
[permalinks]
'genres' = 'books/genres'
'films_genres' = 'films/genres'
front matter for romantic genre
+++
title = 'Romantique'
+++
I need to have _index.md in taxonomies for translate the title.
This is a good way?
Thanks a lot
Is this is a multilingual site? If yes, your content structure above is incorrect.
not really.
Iβm using Netlify CMS and I save content in english folder like:
content/
βββ books/
βββ films/
But my website could be in french
So, is the answer βyesβ or βnoβ ?
no
No. That wonβt work. The permalinks
configuration settting does not apply to section pages, and each of your terms must be a section page. Using your suggestion, your content structure would have to be:
content/
βββ books/
β βββ book-1.md
β βββ book-2.md
βββ films/
β βββ film-1.md
β βββ film-2.md
βββ films_genres/
β βββ mystery/
β β βββ _index.md
β βββ romance/
β β βββ _index.md
β βββ _index.md
βββ genres/
β βββ mystery/
β β βββ _index.md
β βββ romance/
β β βββ _index.md
β βββ _index.md
βββ _index.md
And getting the URLs to work the way you want cannot be done with permalinks. You could change the front matter url
value for each of the term pages, but thatβs a waste of time.
Use my initial suggestion.
Hi Joe,
I did this repo GitHub - sebousan/hugo-test-taxonomies
with, I think, your initial suggestion, true?
Itβs better to have taxonomies inside their section insted of same level?
like this: hugolify-example-site/content at main Β· Hugolify/hugolify-example-site Β· GitHub
(this fake content is used for Hugolify Β· GitHub)
demo: https://demo.hugolify.com
thanks for your time.
Your content structure should look like this:
content/
βββ books/
β βββ genres/
β β βββ mystery/
β β β βββ _index.md
β β βββ romance/
β β β βββ _index.md
β β βββ _index.md
β βββ book-1.md
β βββ book-2.md
βββ films/
β βββ genres/
β β βββ mystery/
β β β βββ _index.md
β β βββ romance/
β β β βββ _index.md
β β βββ _index.md
β βββ film-1.md
β βββ film-2.md
βββ _index.md
That wonβt work with nested taxonomies.
Hi Joe,
Iβm afraid I donβt understand.
I do not understand the gain in relation to my structure
How to configure [permalinks] to have:
/books
β /livres
/books/genres
β /livres/types
(genres is the same word in french, I change it for this example)/books/genres/romatic
β /livres/types/romantique
I doesnβt want to use url
in frontmatter to do that
We are not communicating very well.
Please try this.
git clone --single-branch -b hugo-forum-topic-42828 https://github.com/jmooring/hugo-testing hugo-forum-topic-42828
cd hugo-forum-topic-42828
hugo server
Iβm sorry, Iβll try to be more clear
thanks, its great.
So I need to keep (for netlify cms) your structure and name of folders but I would like translate it to french (only one language): title and permalinks (not the folders names).
Permalinks becomes:
http://localhost:1313/books/book-1/
become http://localhost:1313/livres/livre-1/
http://localhost:1313/books/genres/mystery/
become http://localhost:1313/livres/genres/mytere
this is my problem
So this URL is OK?
And this one is not?
yes with permalinks like:
[permalinks]
books = 'livres/:slug'
'books/genres' = 'livres/genres/:slug'
There is an open issue (proposal) about this:
https://github.com/gohugoio/hugo/issues/8523
To get this:
http://localhost:1313/livres/
You need to do this:
content/books/_index.md
+++
title = 'Livres'
date = 2023-02-10T13:17:44-08:00
draft = false
url = 'livres'
+++
To get this:
http://localhost:1313/livres/genres/
You need to do this:
content/books/_index.md
+++
title = 'Genres (books)'
date = 2023-02-09T05:35:49-08:00
draft = false
url = 'livres/genres'
+++
To get this:
http://localhost:1313/livres/genres/romance/
You need to do this:
content/books/genres/romance/_index.md
+++
title = 'Romance (books)'
date = 2023-02-09T05:33:42-08:00
draft = false
url = 'livres/genres/romance'
+++
If I were you, since this is a monolingual site, I would rename the directories and not use permalinks
.