Is there a way to use custom template on dynamic routes?

Hello there, this is my first time using ghost or doing anything like this so please help me out.

I am trying to use custom template on dynamic route, so basically when someone goes to /stats/{any-text} it would load the data from stats-template.hbs.

The closest thing I can try doing is trying to add custom taxonomies but then again I don’t know how to do that.