My director structure is such
-content
|—blog
-----||—blog1
-----||—blog 2
|—ideas
-----||—ideas1
-----||—ideas 2
Resultantly my urls are
-example.com/blog/blog1
-example.com/ideas/ideas1
i.e. (domain) / (section) / (slug)
I want the url structure to continue like as it is, for one section i.e. blogs. -example.com/blog/blog1
However, set the URL structure for other just as the slug i.e. -example.com/ideas1 (domain) / (slug).
Yo are misunderstanding the docs. Slug is the last part of the URL which is what you set in your front matter (or it defaults to the title). So, the part you don’t want in your URL will appear. You should test your suggestion before you conclude what I shared is unnecessary to remove doubt (I did test and it does not work as you expected. Mine works though). You explicitly said
and that is what my solution does. Yours only shows title then slug.
If you have an even deeper hierarchy and you only want the last section you can also do:
[permalinks]
blog = '/:sections[last]/:slug/'
Content created under /blog/sub/subsub/ would have permalinks at /subsub/ instead of /sub/subsub/. This achieves the same as your solution for /blog/sub/ → /sub/.
FYI, this doesn’t change the permalink for the section list page (e.g. /blog/sub/_index.md). I haven’t found a way to achieve this with permalinks but a workaround is manually changing the URL in that page’s frontmatter (url: sub).
Based on my understanding of the docs, url is relative to the root (domain). So, you are are correct about the sections. I went with url for my section pages.