Nid to url in twig [Drupal 8]

What if you have to link to a specific url in in twig, but you only have the nid? Moreover, it is good practice to use the id and not a hardcored url. Here's what you should use:

 {{ path('entity.node.canonical', {'node': 522}) }}

 

 

Saved you some valuable time?

Buy me a drink 🍺 to keep me motivated to create free content like this!