Browse Source

add dark mode

master
alistair 3 years ago
parent
commit
f4e1944497
  1. 1
      atom.xml
  2. 20
      html.template
  3. 1
      media/auto-render.min.js
  4. 1
      media/default.min.css
  5. BIN
      media/fonts/KaTeX_AMS-Regular.ttf
  6. BIN
      media/fonts/KaTeX_AMS-Regular.woff
  7. BIN
      media/fonts/KaTeX_AMS-Regular.woff2
  8. BIN
      media/fonts/KaTeX_Caligraphic-Bold.ttf
  9. BIN
      media/fonts/KaTeX_Caligraphic-Bold.woff
  10. BIN
      media/fonts/KaTeX_Caligraphic-Bold.woff2
  11. BIN
      media/fonts/KaTeX_Caligraphic-Regular.ttf
  12. BIN
      media/fonts/KaTeX_Caligraphic-Regular.woff
  13. BIN
      media/fonts/KaTeX_Caligraphic-Regular.woff2
  14. BIN
      media/fonts/KaTeX_Fraktur-Bold.ttf
  15. BIN
      media/fonts/KaTeX_Fraktur-Bold.woff
  16. BIN
      media/fonts/KaTeX_Fraktur-Bold.woff2
  17. BIN
      media/fonts/KaTeX_Fraktur-Regular.ttf
  18. BIN
      media/fonts/KaTeX_Fraktur-Regular.woff
  19. BIN
      media/fonts/KaTeX_Fraktur-Regular.woff2
  20. BIN
      media/fonts/KaTeX_Main-Bold.ttf
  21. BIN
      media/fonts/KaTeX_Main-Bold.woff
  22. BIN
      media/fonts/KaTeX_Main-Bold.woff2
  23. BIN
      media/fonts/KaTeX_Main-BoldItalic.ttf
  24. BIN
      media/fonts/KaTeX_Main-BoldItalic.woff
  25. BIN
      media/fonts/KaTeX_Main-BoldItalic.woff2
  26. BIN
      media/fonts/KaTeX_Main-Italic.ttf
  27. BIN
      media/fonts/KaTeX_Main-Italic.woff
  28. BIN
      media/fonts/KaTeX_Main-Italic.woff2
  29. BIN
      media/fonts/KaTeX_Main-Regular.ttf
  30. BIN
      media/fonts/KaTeX_Main-Regular.woff
  31. BIN
      media/fonts/KaTeX_Main-Regular.woff2
  32. BIN
      media/fonts/KaTeX_Math-BoldItalic.ttf
  33. BIN
      media/fonts/KaTeX_Math-BoldItalic.woff
  34. BIN
      media/fonts/KaTeX_Math-BoldItalic.woff2
  35. BIN
      media/fonts/KaTeX_Math-Italic.ttf
  36. BIN
      media/fonts/KaTeX_Math-Italic.woff
  37. BIN
      media/fonts/KaTeX_Math-Italic.woff2
  38. BIN
      media/fonts/KaTeX_SansSerif-Bold.ttf
  39. BIN
      media/fonts/KaTeX_SansSerif-Bold.woff
  40. BIN
      media/fonts/KaTeX_SansSerif-Bold.woff2
  41. BIN
      media/fonts/KaTeX_SansSerif-Italic.ttf
  42. BIN
      media/fonts/KaTeX_SansSerif-Italic.woff
  43. BIN
      media/fonts/KaTeX_SansSerif-Italic.woff2
  44. BIN
      media/fonts/KaTeX_SansSerif-Regular.ttf
  45. BIN
      media/fonts/KaTeX_SansSerif-Regular.woff
  46. BIN
      media/fonts/KaTeX_SansSerif-Regular.woff2
  47. BIN
      media/fonts/KaTeX_Script-Regular.ttf
  48. BIN
      media/fonts/KaTeX_Script-Regular.woff
  49. BIN
      media/fonts/KaTeX_Script-Regular.woff2
  50. BIN
      media/fonts/KaTeX_Size1-Regular.ttf
  51. BIN
      media/fonts/KaTeX_Size1-Regular.woff
  52. BIN
      media/fonts/KaTeX_Size1-Regular.woff2
  53. BIN
      media/fonts/KaTeX_Size2-Regular.ttf
  54. BIN
      media/fonts/KaTeX_Size2-Regular.woff
  55. BIN
      media/fonts/KaTeX_Size2-Regular.woff2
  56. BIN
      media/fonts/KaTeX_Size3-Regular.ttf
  57. BIN
      media/fonts/KaTeX_Size3-Regular.woff
  58. BIN
      media/fonts/KaTeX_Size3-Regular.woff2
  59. BIN
      media/fonts/KaTeX_Size4-Regular.ttf
  60. BIN
      media/fonts/KaTeX_Size4-Regular.woff
  61. BIN
      media/fonts/KaTeX_Size4-Regular.woff2
  62. BIN
      media/fonts/KaTeX_Typewriter-Regular.ttf
  63. BIN
      media/fonts/KaTeX_Typewriter-Regular.woff
  64. BIN
      media/fonts/KaTeX_Typewriter-Regular.woff2
  65. 1296
      media/highlight.min.js
  66. 1
      media/katex.min.css
  67. 1
      media/katex.min.js
  68. 62
      media/style.css
  69. 4
      pages/about.md
  70. 9
      projects/powdersim.md
  71. 69
      projects/stgen3.md
  72. 14
      stgen.json

1
atom.xml

@ -0,0 +1 @@ @@ -0,0 +1 @@
{{feed:posts,game,projects}}

20
html.template

@ -9,19 +9,21 @@ @@ -9,19 +9,21 @@
<link rel="stylesheet" type="text/css" href="{{:url}}/media/style.css">
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
href="{{:url}}/media/default.min.css">
<script src="{{:url}}/media/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
<link rel="stylesheet" href="{{:url}}/media/katex.min.css">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
<script defer src="{{:url}}/media/katex.min.js"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"
onload="renderMathInElement(document.body);"></script>
<script defer src="{{:url}}/media/auto-render.min.js"
onload="renderMathInElement(document.body);">
</script>
</head>
</head>
@ -40,6 +42,7 @@ @@ -40,6 +42,7 @@
<li class=menu_item><a href="https://git.topost.net/alistair">git</a></li>
<li class=menu_item><a href="{{:url}}/projects">projects</a></li>
<li class=menu_item><a href="{{:url}}/notes">uni</a></li>
<li class=menu_item><a href="https://thonk.space">matrix server</a></li>
</ul>
</div>
@ -51,9 +54,14 @@ @@ -51,9 +54,14 @@
</header>
{{ :body}}
</hr>
</div>
</div>
</div>
</body>
</html>

1
media/auto-render.min.js vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),a=function(e,t,r){for(var n=r,o=0,a=e.length;n<t.length;){var i=t[n];if(o<=0&&t.slice(n,n+a)===e)return n;"\\"===i?n++:"{"===i?o++:"}"===i&&o--,n++}return-1},i=function(e,t,r,n){for(var o=[],i=0;i<e.length;i++)if("text"===e[i].type){var l=e[i].data,d=!0,s=0,f=void 0;for(-1!==(f=l.indexOf(t))&&(s=f,o.push({type:"text",data:l.slice(0,s)}),d=!1);;){if(d){if(-1===(f=l.indexOf(t,s)))break;o.push({type:"text",data:l.slice(s,f)}),s=f}else{if(-1===(f=a(r,l,s+t.length)))break;o.push({type:"math",data:l.slice(s+t.length,f),rawData:l.slice(s,f+r.length),display:n}),s=f+r.length}d=!d}o.push({type:"text",data:l.slice(s)})}else o.push(e[i]);return o},l=function(e,t){var r=function(e,t){for(var r=[{type:"text",data:e}],n=0;n<t.length;n++){var o=t[n];r=i(r,o.left,o.right,o.display||!1)}return r}(e,t.delimiters);if(1===r.length&&"text"===r[0].type)return null;for(var n=document.createDocumentFragment(),a=0;a<r.length;a++)if("text"===r[a].type)n.appendChild(document.createTextNode(r[a].data));else{var l=document.createElement("span"),d=r[a].data;t.displayMode=r[a].display;try{t.preProcess&&(d=t.preProcess(d)),o.a.render(d,l,t)}catch(e){if(!(e instanceof o.a.ParseError))throw e;t.errorCallback("KaTeX auto-render: Failed to parse `"+r[a].data+"` with ",e),n.appendChild(document.createTextNode(r[a].rawData));continue}n.appendChild(l)}return n};t.default=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},function e(t,r){for(var n=0;n<t.childNodes.length;n++){var o=t.childNodes[n];if(3===o.nodeType){var a=l(o.textContent,r);a&&(n+=a.childNodes.length-1,t.replaceChild(a,o))}else 1===o.nodeType&&function(){var t=" "+o.className+" ";-1===r.ignoredTags.indexOf(o.nodeName.toLowerCase())&&r.ignoredClasses.every(function(e){return-1===t.indexOf(" "+e+" ")})&&e(o,r)}()}}(e,r)}}]).default});

1
media/default.min.css vendored

@ -0,0 +1 @@ @@ -0,0 +1 @@
.hljs{display:block;overflow-x:auto;padding:.5em;background:#f0f0f0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#bc6060}.hljs-literal{color:#78a960}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}

BIN
media/fonts/KaTeX_AMS-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_AMS-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_AMS-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Bold.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Bold.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Bold.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Caligraphic-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Bold.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Bold.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Bold.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Fraktur-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Bold.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Bold.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Bold.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Main-BoldItalic.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Main-BoldItalic.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Main-BoldItalic.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Italic.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Italic.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Italic.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Main-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Math-BoldItalic.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Math-BoldItalic.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Math-BoldItalic.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Math-Italic.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Math-Italic.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Math-Italic.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Bold.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Bold.woff

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Bold.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Italic.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Italic.woff

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Italic.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_SansSerif-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Script-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Script-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Script-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Size1-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Size1-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Size1-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Size2-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Size2-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Size2-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Size3-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Size3-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Size3-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Size4-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Size4-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Size4-Regular.woff2

Binary file not shown.

BIN
media/fonts/KaTeX_Typewriter-Regular.ttf

Binary file not shown.

BIN
media/fonts/KaTeX_Typewriter-Regular.woff

Binary file not shown.

BIN
media/fonts/KaTeX_Typewriter-Regular.woff2

Binary file not shown.

1296
media/highlight.min.js vendored

File diff suppressed because one or more lines are too long

1
media/katex.min.css vendored

File diff suppressed because one or more lines are too long

1
media/katex.min.js vendored

File diff suppressed because one or more lines are too long

62
media/style.css

@ -1,7 +1,19 @@ @@ -1,7 +1,19 @@
:root {
--primary-fg: black;
--primary-bg: white;
--primary-link: #0066cc;
--secondary-bg: #eee;
--borders: #bbb;
}
code {
white-space: pre-wrap;
background: #eee;
border-color: #eee;
background: var(--secondary-bg);
border-color: var(--secondary-bg);
border-radius: 6px;
border-style: solid;
border-left-width: 4px;
@ -10,12 +22,15 @@ code { @@ -10,12 +22,15 @@ code {
border-bottom-width:1px;
}
a {
}
.title {
margin-top:18px;
}
div.sourceCode {
background: #eee;
background: var(--secondary-bg);
border-radius: 7px;
}
@ -30,7 +45,7 @@ code { @@ -30,7 +45,7 @@ code {
pre {
font-family: 'Bitstream Vera Sans Mono', 'Monospace', monospace;
background: #eee;
background: var(--secondary-bg);
border-radius:6px;
padding: 0.7em;
}
@ -52,7 +67,7 @@ dl { @@ -52,7 +67,7 @@ dl {
dl dt {
font-size:0.6em;
font-weight:200;
font-weight:400;
}
dl dd {
@ -63,12 +78,14 @@ dl dd { @@ -63,12 +78,14 @@ dl dd {
}
dl dd a {
color:black;
color:var(--primary-fg);
}
body {
font-family: 'Bitrstream Vera Sans', Helvetica Neue, Helvetica, sans-serif, sans;
font-size: 18px;
color:var(--primary-fg);
background:var(--primary-bg);
}
@ -101,8 +118,7 @@ h1, h2, h3, h4, h5, h6 { @@ -101,8 +118,7 @@ h1, h2, h3, h4, h5, h6 {
a {
text-decoration:none;
color: #0066cc;
color: var(--primary-link);
}
@ -112,7 +128,7 @@ div.main_page { @@ -112,7 +128,7 @@ div.main_page {
hr {
border-style: solid;
color: #bbb;
color: var(--borders);
border-width:0.1em;
}
pre.numberSource {
@ -182,12 +198,14 @@ q { @@ -182,12 +198,14 @@ q {
.title {
margin-top:10px;
}
}
blockquote {
border-left: #bbb;
border-left: var(--borders);
border-left-style: solid;
border-left-width: 0.2em;
padding:0.6em;
@ -200,7 +218,7 @@ blockquote p { @@ -200,7 +218,7 @@ blockquote p {
tr:nth-child(even) {background-color: #eee;}
tr:nth-child(even) {background-color: var(--secondary-bg);}
table {
border-collapse: collapse;
@ -226,3 +244,23 @@ td { @@ -226,3 +244,23 @@ td {
.date {
font-size:0.85em;
}
@media (prefers-color-scheme: dark) {
:root {
--primary-fg: white;
--primary-link: #90e0ff;
--primary-bg: black;
--secondary-bg: #222;
--borders: #bbb;
}
dl dt {
font-size:0.6em;
font-weight:400;
}
}

4
pages/about.md

@ -1,9 +1,13 @@ @@ -1,9 +1,13 @@
---
title: Me
Subscribe via [RSS (Atom)](https://alistairmichael.com/atom.xml).
### Contacts
- email: mail at alistairmichael.com
- matrix: alistair@thonk.space
- git: [git.topost.net/alistair](https://git.topost.net/alistair/)

9
projects/powdersim.md

@ -12,8 +12,10 @@ everything I'd ever known about initializers, RAII and OOP. @@ -12,8 +12,10 @@ everything I'd ever known about initializers, RAII and OOP.
</video>
```
After wasting too much time trying to find a UI toolkit that I could tolerate
learning for fun I stumbled upon
I started my holiday thinking about writing some simple graphic user interface
app, and after wasting too much time trying to find a UI toolkit that I could
tolerate learning for fun (wx, gtk, and qt are all, unsurprisingly, not simple)
I stumbled upon
[this nice video](https://www.youtube.com/watch?v=VLZjd_Y1gJ8) about writing
a simple sand physics game and thought it would be much more fun to work on
something conceptually simple and satisfying, compensate for C++'s induced headaches.
@ -42,7 +44,7 @@ correctly. Particle behaviour can be defined via inheritance relations, and the @@ -42,7 +44,7 @@ correctly. Particle behaviour can be defined via inheritance relations, and the
colour palettes, default physics values, et cetera, are still separated from the
actual class definitions so I can easily serialise them to and from the disk if
I want to implement that some time (I probably won't). I do really enjoy having
RAII and overloading. Perhaps mosst, I appreciate the greater expressiveness of
RAII and overloading. Perhaps most, I appreciate the greater expressiveness of
C++ code over C, where I often find myself off yak-shaving something to do with
`char *` arrays.
@ -52,3 +54,4 @@ or Java without it being a huge pain. Maybe that is too ambitious. At any rate, @@ -52,3 +54,4 @@ or Java without it being a huge pain. Maybe that is too ambitious. At any rate,
its probably the best option for working on games, and I like pointers too much
now.

69
projects/stgen3.md

@ -0,0 +1,69 @@ @@ -0,0 +1,69 @@
---
title: ANOTHER Static Site Generator, C++ version
date: 31-01-21
---
I fear this blog is reaching a critical-mass of posts about its static site
generator (SSG). Especially given its pageview count is about 1 a
quarter, which is probably me.
For the past year it has been built using a Python script and pandoc.
Recently I decided to write a more substantial SSG in C++,
using the multimarkdown parser library, which is implemented in C.
Largely this was inspired by multimarkdown's 10ms/page render time brings the
compile time of the website from around 5 seconds to
200ms. It also allows it to be built entirely in memory without having to
use temporary files or caching (I could do that with pandoc if I _wanted_ to
redirect `stdin` and `stdout`) -- largely it is because I want a more
maintainable project. Even C++ code is more rigid than Python.
Despite this of course, I cannot escape the question: Does the world need
another static site generator, and what makes this any different to Hugo or
Jekyll?
The first part, I cannot really provide a good answer for---but it isn't enough
to stop me from writing it anyway. I would like to have my own solid SSG regardless of
whether it _really_ brings anything new. It has at least fixed the bugs in the
Python version.
The main idea is that the file tree should be the main way of categorising
content: not tags, post categories, blogs, et cetera. As such the core design
considerations were:
1. Be able to run it in an arbitrary directory and generate a website site without
providing a lot of configuration: do not assert any structure on the files
and directory tree of the source, and leverage the filesystem as much as
possible.
2. Be simple to template: templates are part of the same source code as
the content. It should be completely out of the way except when you want to give
it a nudge towards some specific behaviour.
3. Be complete as a single binary: bundle dependencies and
be self-documenting.
4. Be easy to port to Windows and Mac, be fast, small and simple as possible.
This list is largely inspired by the design philosphy of [100 Rabbits](https://100r.co/site/philosophy.html),
which I came across recently and found to have succinctly summarised the
characteristics of the software I like to use and create. And, I find most of
the software annoyances I regularly face are the complements of their list: software that needs
the internet to function, hampered by DRM and activation key servers, distribution
systems that break once they become 2 versions out of date, and unneccessarily high
CPU and energy resource requirements.
Regardless, [here is the code and what it does.](https://git.topost.net/alistair/stgen3)
The notable features that are currently missing are
- A watch and update mode
- A built in server
- RSS/Atom Feeds
I do not have immediate plans to add these.
For more on building pointless static site generators consider reading [this
article](https://erikwinter.nl/articles/2020/why-i-built-my-own-shitty-static-site-generator/).
It was at least some of the inspiration for writing mine.
# WHY C++?
Because I want to learn it.

14
stgen.json

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
{
"author": "alistair michael",
"author": "Alistair Michael",
"date-in-format": "%d-%m-%y",
"date-out-format": "%a, %b %d, %Y",
"name": "alistairmichael.com",
"publish_root": "/home/alistair/Documents/programming/stgen3/build/alistairmichael",
"source_root": "/home/alistair/Documents/programming/stgen3/build/alist",
"url": "http://localhost:8080"
}
"date-out-format": "%a %b %d %Y",
"name": "alistair michael",
"publish_root": "/home/alistair/Documents/programming/alistairmichael.com/public",
"source_root": "/home/alistair/Documents/programming/alistairmichael.com/src",
"url": "https://alistairmichael.com/"
}

Loading…
Cancel
Save