How to change post title route to include tags in routes.yaml

By default, the post URL/route is:

mydomain.com/this-is-a-post-title/

How do I change that in routes.yaml, so it’s:

mydomain.com/tag_name/this-is-a-post-title/

As examples,

mydomain.com/news/this-is-a-post-title/
mydomain.com/business/this-is-a-post-title/

Thank you.

You can modify your collection’s permalink in the routes.yaml file:

collections:
  /:
    permalink: /{primary_tag}/{slug}/

Thank you!