Logo

Daniel Bleisteiner

A New Beginning...

Over the past few years my website has been rather static. There were only a few pages and hardly any new content. Like so many others I had become more of a consumer, rarely putting any content on the web myself. But sometimes there are experiences I want to share. My own thoughts, my opinions or simply insights that have helped me move forward.

What was...

So over the last few weeks I made several attempts to get along with Wordpress – without success. I looked for alternatives and tried GitHub Pages. I took a closer look at Jekyll and then spent some time with MkDocs. I was even close to writing my own SpringBoot application to manage my site. But somehow I always end up going back to static pages and my own CSS.

As much as I have come to appreciate Markdown – in the end you only have full control over the result when you write the HTML yourself. And I want to keep learning, try new things and gather my own experiences. But the more complex a website gets, the more you need little helpers. You don't want to maintain the menu on every page by hand, keep adjusting the footer and manually keep many pages in sync.

What will be...

What works best for me at the moment is SSI – Server-Side Includes. It is a small extension of the Apache web server that allows, among other things, to assemble pages from multiple building blocks and thus write the same header and footer of a website only once. Before the page is actually delivered, the server assembles it from multiple parts and generates the finished document. Without PHP or other scripting languages that I would rather not use.

To enable SSI, only a few lines in the already existing .htaccess file are needed:

# Working with SSI from now on.
Options +IncludesNOEXEC
AddOutputFilter INCLUDES .html
In my case I let all HTML files be processed accordingly. Assembling the individual building blocks is equally simple – a single #include is enough:
<!DOCTYPE html>
<html lang="en">

<!--#set var="subtitle" value="Blog" -->
<!--#include virtual="/en/includes/head.html" -->

<body id="top">

    <!--#include virtual="/en/includes/header.html" -->

    <p>Hello World!</p>

    <!--#include virtual="/en/includes/footer.html" -->

</body>
</html>

One downside of this approach is that you can no longer preview pages locally. SSI only works with a server, so you have to deploy changes to see them in full. Alternatively you could run a local Apache HTTP server – but that doesn't necessarily make things easier.

What remains...

This will certainly not be my last approach to managing the content of my website. At least for the moment I can live with it. How often I will actually publish new content in the end remains to be seen.