SerePublish the new website generator

I started my own website back in 2018 using Django and custom add-ons. In 2023 I switched to a custom website server based on FastAPI called SereServe. This was due to a need to have full control over the way the website is processed and be leaner by using less dependencies. Nevertheless, this was still too bloated and, since it was based on clean architecture, modifications were still tedious. So I decided to rewrite the website logic one more time.

This time I made sure to only write a generator which uses pandoc to export (mostly Org-mode) contents and handle templating system. The server part is delegated to nginx.

Export system uses a minimal set of Python dependencies, pillow for image processing (mostly watermarking and resizing images) and yaml to write metadata for pandoc export. I was tempted to use Jinja2 for template system as the pandoc template system support is much more basic. However I could finally manage to do everything via pandoc. For example nested metadata, be it list or dictionary, is very tricky to manage, for example in this part of the top page creation, I had to use the dictionary key to be able to show sections correctly but had to also include an index to force the order to be kept when the file is exported but also make it hidden using HTML span:

section = (
    f'<span style="visibility: hidden;"><sub>{ind}</sub></span>{sections_prefix} '
    f'<strong>{section}</strong><a href="/{section_subpath}">'
    f'<span class="badge text-bg-secondary mx-3">show all</span></a>'
)

I also decided to drop the programmed redirections to avoid breaking older links crawled by search engines since I don't want to drag an unnecessary feature just to keep search engines and bookmarks happy. Thus, in the new version, you may get a 404 error more often.

This rewrite allowed me to publish a series of photos I recently took much easier than before since no manual editing is not required. Take a look at new albums Schloss Neuschwanstein, Frankfurt, Heidelberg and London among others.

As before, the website runs with javascript fully disbled, is containerized and a allows a proxy server to handle SSL and redirections. The code for the new website can be found in the SerePublish repo and still needs a lot of attention in terms of documentation and cleanups.