sysid blog

Reboot

Success is not always a straight line.

Blog Requirements

Switch to Gatsby

End of 2018 I switched from Hugo to Gatsby because why not. Gatsby was the new-kid-on-the-block and it is based on React and GraphQL, which I wanted to learn anyway. At the time I could tick above boxes, especially because my blog was tiny and I was dealing with React in other projects.

Evolution

The blog got bigger and I changed focus from React to backend. This resulted in:

  1. Context switch to deal with Gatsby internals required increasing effort
  2. Build times became very long

Overall the feeling grew, that the techstack, despite being very capable, being overkill for a simple blog and effort vs. benefit got out of balance.

Switch back to Hugo

Due to initial experience with Hugo, the learning curve was virtually non existent.

However, migrating the pages took more than expected. I do have some math-heavy pages and on Gatsby I was using Katex whereas on Hugo I decided to go for Mathjax.

Why Mathjax

Mathjax Setup for 4 alpha:

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@4.0.0-alpha.1/es5/tex-mml-chtml.js"></script>

<!-- this part configures it -->
<script>
    MathJaxDone = new Promise((resolve, reject) => {
        window.MathJax = {
            tex: {inlineMath: [['$', '$'], ['\\(', '\\)']]},
            startup: {
                pageReady() {
                    return MathJax.startup.defaultPageReady().then(resolve);
                }
            }
        }
    });
</script>

Unfortunately the Latex markup did have subtle incompatibilities and required manual work despite the fact, that most of the adjustments could be automated by regexp substitutions.

Result

  1. Hugo’s templating concpets are more accessible for me with less indirection and ‘magic’. GraphQL might be a good thing for API developmemnt but definitely not for simple Blog sites.
  2. Build times went down by more than a factor of 20! The generated artefacts of Gatsby might be more sophisticated (e.g. partial loading, etc) but this does not matter here.
  3. Overal structure is simpler and the bearblog theme is crisp and clear.

#learning #productivity