loconotion
loconotion copied to clipboard
Pretty URLs instead of Ugly URLs
Currently script generates pages with slug in filename
Ex: blog.html
It creates ugly url like /blog.html
with .html
extension
It would be great to have feature to generate pages in folders and with file index.html in it
Ex: /blog/index.html
In the result url path will look like /blog
without .html
extension
You can see example in Hugo site https://gohugo.io/content-management/urls/#pretty-urls
This makes sense - I've been using netlify for my static deployments and they have automatic pretty urls resolving (so /portal resolves to portal.html) but I understand some other hosting options might not support this.
While re-working this, it's worth considering outputting the assets (e.g images and such) into a separate folder as well to keep the dist
folder kind of clean.
But you retain the .html extension in the page links? This is actually less desirable from an SEO perspective. I am running nginx with a rewrite to prettify the URLs but also changed the default for the extension variable in get_page_slug() to False. That way the slugs get written without the extension in the html page. I then added the extension back in when the file is written, so the files still end in .html.