Since rewriting my website with Quickblog, one thing has bothered me: all pages are rendered to page.html
files and linked together with the .html
file extension in the url.
Being biased for making the change I want to see in the world, I decided to build it myself, but when I started to look into how to implement this feature, I came across an undocumented setting for Quickblog: :page-suffix
.
If we set :page-suffix
to an empty string, then links won't include the .html
extension anymore. But this creates a new problem: when running bb quickblog watch
, the local server doesn't know to rewrite /page
to /page.html
.
The solution to this was also quite simple: in bb.edn
, I have one quickblog command for developing and another command for building the production version.
{:deps {io.github.borkdude/quickblog
{:git/sha "caffe692c8d715b30c8851ab8210dbabb19a1785"}}
:tasks
{:requires ([quickblog.cli :as cli])
:init (def opts {:blog-title "My blog title"
:blog-description "My blog description"})
quickblog {:doc "Development mode. Run `bb quickblog help` for details."
:task (cli/dispatch opts)}
quickblog-prod {:doc "Production mode. Run `bb quickblog-prod help` for details."
:task (cli/dispatch (assoc opts :page-suffix ""))}}}
When I'm developing and writing posts locally, I run the regular bb quickblog watch
. In my Github action that builds and deploys the website to Github Pages, I instead use bb quickblog render
.
Github Pages comes with out-of-the-box support for extension-less paths, so accessing adamrenklint.com/foo
will actually load adamrenklint.com/foo.html
.
Published: 2025-03-16