Skip to content
Advertisement

Pelican – How to remove .html extension on local host

I have a pelican blog and I want to remove the .html extension from the URL. I added the following to pelicanconf.py

JavaScript

The problem is that invoke livereload doesn’t serve the urls without html extension. pelican --autoreload --listen does, but it doesn’t automatically refresh my browser on changes.

Any solution to enjoy the best of both worlds?

Advertisement

Answer

Make use of the *_URL and *_SAVE_AS configuration options.

E.g.:

JavaScript

The above does rely on the fact that webservers will provide the “index.html” file when you attempt to browse a directory directly, but this is near-universal behaviour.

You can do the above for any *_URL setting. Further example:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement