Chapter endnotes

I’d like to have endnotes for certain chapters in my project. I want these endnotes to be omitted from the table of contents and only reachable by a link.

Ideally, I’d like to have a new Text document at the end of the chapter called “Endnotes” (and a corresponding section type). The part I’ve not figured out yet is creating the link to have at the end of the chapter.

At the end of a chapter, I want a link to be inserted that says “Chapter N Endnotes” that, when tapped, takes you to the endnotes text. I could probably do this with two text documents at the end of each chapter, but that feels sub-optimal. I’m hoping to find a way to automatically generate the link for a chapter.

What’s the best way to accomplish this?