Removing .html extension from page url?

I have a site with content using .html files and no markdown. The valid urls corresponding to these pages always end in .html just like the files. Is there a way to remove the .html part and serve just the filename without the extension?


I tried adding frontmatter at the top of the html file in the content directory and setting slug and url parameters to the desired url but the behavior didn’t change.

Edit: Nevermind, that works now. I must’ve been doing something wrong. However the body of my page isn’t showing up now. Just the partials from baseof.html. Both my slug and url are set to “/contact/” and the page is contact.html in the top level of the content directory.

I figured out a fix for anyone else who may have this problem in the future. I replaced my html templates in /content with and added the html templates themselves to layouts with the same name as their respective content directory. I hope this approach works but if it doesn’t I’ll update this post.

What you also can is to add some front matter to these HTML files (even if it’s empty).

I had frontmatter added and it still wasn’t serving content without the .html extension. Maybe I had something else configured wrong. Regardless, I like the approach of keeping my .html files in layouts and using just markdown files in content.