uglyURLS with .htm

I am trying to change the URLs from a folder based structure so that an old site I am bringing over to Hugo keeps its existing URL structure with URLs ending in .htm.

I am unable to figure out how to do this. I have read the documentation and it seems it it either out of date or I am doing it wrong :expressionless:

Here is my config.yml:

mediaTypes:
  mediaTypes.text/html:
    suffixes:
    - .htm

outputFormats:
  outputFormats.HTML:
    mediaType: "text/html"

permalinks:
  posts: "/newsletters/newsletter_:06:month"
  tags: "/tags/:slug"

This config does not work as all the URLs end in .html

Please help me or point me in the correct direction. Thank you in advance!

config.yaml

mediaTypes:
  text/html:
    suffixes:
    - htm

outputFormats:
  HTML:
    mediaType: text/html

permalinks:
  posts: /newsletters/newsletter_:06:month
  tags: /tags/:slug

Also, your templates must have htm extension.

layouts/
ā””ā”€ā”€ _default
    ā”œā”€ā”€ baseof.htm
    ā”œā”€ā”€ list.htm
    ā””ā”€ā”€ single.htm
2 Likes

@jmooring !!!

The templates are .HTML, so that must have been the problem. Thank you so much for helping and bringing this to my attention. I will make a git branch tonight and give this a shot!

Thank you!!!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.