How to use an html file for a route

I am using a hugo theme ( papermod ) and I want some custom html files to be served for a route ( say /about → about.html ) I tried adding about.html to baseof directory but it’s not working.

and also I’m still getting single.html template when i add

I want to keep the layout ( with header and footer ) but want to serve about.html for /about ( with or without in content )

Place your file here: /static/about/index.html

Anything in the static directory is copied to the public directory, using the same relative path, when you build your site.

Having said that, I don’t think this is a good idea. With your approach Hugo has no knowledge of “about” as a page. That means it’s not part of Hugo’s content map:

  • It won’t be a member of any page collection
  • It cannot have taxonomy terms
  • It is not find-able with .Page.GetPage or .Site.GetPage
  • It won’t work with the pageRef property for menu entries
  • etc.