I am using Eleventy to build a simple site, where all pages so far share the same layout. I am trying to minimise the amount of repetition in the front matter of each page template. The default with Eleventy is for 'mypage.njk' to result in 'mypage/index.html', whereas what I want is simply 'mypage.html'. To effect this, I have this in the front matter of each template:
permalink: <%= `${page.filePathStem}.html` %>
Is there some way of making this global, so I don't have to specify it each time (but could override it if necessary)?
I guess I have a kind of answer to my own question. I find I can use front matter in the page layout. So if I put
in the front matter of the layout, all templates which use this layout default to that permalink. Handy!