loconotion icon indicating copy to clipboard operation
loconotion copied to clipboard

Pretty URLs instead of Ugly URLs

Open osadasami opened this issue 4 years ago • 2 comments

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

osadasami avatar Oct 10 '20 13:10 osadasami

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.

leoncvlt avatar Oct 19 '20 07:10 leoncvlt

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.

mmuelly avatar Feb 03 '21 07:02 mmuelly