Creating links to ECK Entities in Twig
This post is mostly so I don't forget, as it took several hours to figure out.
Recently, I needed to create some links in a twig templates to various ECK ( Entity Construction Kit ) entity types, mostly to Add, View, and Edit. Now, it's not really a good idea to try building the paths manually, since the paths may change ( if I update the pathauto patterns or something ). Routes are much more stable.
In Twig, there are two main functions for generating links, link() and path(). Link creates an absolute URL, while path ( wait for it ) creates a path or relative URL.