Quite old topic but the problem persists:
What if I’d like to transform content/post/<my-memories>/<memory-1> available at mysite.com/post/<my-memories>tomysite.com/<my-memories>?
Your question seems to be unrelated to Taxonomies since you are asking about making a page residing under: content/post/<my-memories>/<memory-1> to have a permalink without the section name /post/.
I have moved it to its own topic, since the other one had not seen any activity in 4 years. We discourage bumping of old topics.
With that said you can set the url parameter in a page’s front matter to whatever you wish.
No you need to set the url parameter in the actual content page -from your post above it seems that you need to do this in the front matter of memory-1.md and not in it the _index.md of its Nested Section my-memories.
Please share the repo or if you cannot provide a sample repo. In the README write exactly which content file you want to have a different URL than its default one.
We need to see the full context of what’s going on in your project.
Of course they are published! I can see them in the list of posts. But I can see them even after I create the file ravpower.md…just I don’t see the link changing.
If you clone it and test it locally, you will see that when one visits: http://localhost:1313/accessori/ravpower/ the page under /content/post/accessori/ravpower.md is published.
Well, I can just send you a very big thank you for the time you used to help me.
Your example works only when you insert url: "my-url" into each of the .md files ravpower.md is supposed to be ravpower/ (a folder) in which there are several other files such as charger.md, powerbank.md etc.
Your example works only if I insert url into each of those .md files. Better than nothing though, even if in such a way I have to invent a title for each url of the file to be pointed whereas in normal conditions it’s hugo to do so
If you want to hide the /post/ section from the permalinks of all children pages then you can do the following:
In config.toml configure the Permalinks for the /post/ section like so:
[permalinks]
post = "/accessori/:filename"
With the above you will not have to manually enter a url parameter in the front matter of each page.
The :filename variable refers to the filename of a content file but if you choose to use Page Bundles it will refer to the name of the folder that contains an index.md
But in such a way I cannot access in the correct way to other “categories” (cfr. Fotografia) that is another category for me because all the traffic is directed to accessori:
Hi @alexandros. at the end I gave up and I changed the tree of my content removing definitively the post/ folder. I was just wondering, anyway, if there would be anyway to shortcut the formation of the parameter url something like
Template variables and functions are not available in the Front Matter of content files but only for Archetypes.
However since you removed the parent /post/ folder and the product sections now live directly under the contentDir you can configure each section’s permalinks in the config, without needing to use the url parameter.