Dynamic files with file extension .html

Hi Community,

i‘ve some static files like 404.html or imprint.html, legal.html and more…

At the moment i‘ll save all these files under the static folder, but for some reasons i‘ll put some dynamic things inside (like minify dynamic css and more)

Is there a best practice to create dynamic .html files who have the location direct under the root (example: www.domain.tld/legal.html or www.domain.tld/legal/) i‘ve not found an example, or maybe i search for the false things…

Thank you

Uh? What exactly do you mean by “dynamic”? It doesn’t seem to be something that isn’t static.

Maybe you’re talking about creating pages with different layout than the usual “single.html”? Like, if you wanted a layout for a “legal” page, for example, you could create a layouts/_default/legal.html and a contents/legal-stuff.md with the layout: "legal" specified at the front matter.

Also, check the documentation about the custom 404 page.

1 Like

Thank you!
This gives me more understanding. My problem is, i become a 404 if i type in /localhost:1313/legal/ -
my folder structure is:


  • legal.md
  • theme
    – mytheme
    — layouts
    ---- _default
    ----- legal.html

Do i make a mistake?

Thank you

And additional: the sitemaps renders “tld.com/legal/

Is this marked as a draft? Is the layout specified? Sorry, I don’t think I have enough details.