~mika/kethel2

b0d10c062370a7700908faf59b7656882dd0c21a — m1ka 25 days ago afb16cd
nearly done just finishing some last phrasing pre-release
M .gitignore => .gitignore +1 -0
@@ 6,3 6,4 @@
/out/**/*
/obj/**/*
/publish
dist.tar.gz

M Makefile => Makefile +5 -1
@@ 3,10 3,14 @@ CFLAGS=-Wall -Wextra -Werror -pedantic -O2 -std=c99

DEVSERVER='https://raw.githubusercontent.com/emikulic/darkhttpd/refs/heads/master/darkhttpd.c'

.PHONY: all serve pages
.PHONY: all serve pages dist

all: mkpage aggregate pages out/favicon.ico

dist: pages
	rm -f dist.tar.gz
	tar czvf dist.tar.gz out

serve: all darkhttpd
	./darkhttpd out


D TODO => TODO +0 -6
@@ 1,6 0,0 @@
- media reviews n so
- atom feeds (microblog: done, todo macro & reviews);

atom feed is NEARLYYY done for /microblog, /macroblog still needs some work

/reviews is generally a more specialised form of blog, maybe cool stats?

M include/stdhead.html => include/stdhead.html +13 -7
@@ 2,9 2,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<style>
p {
    font-size: 16px;
}
body { font-size: 16px; }
blockquote { margin: 1em 0; }
figcaption {
  font-style: italic;


@@ 12,17 10,25 @@ figcaption {
}
a {
    font-style: italic;
    color: #ee41b4;
    color: #0000FF;
}
a:visited {
    font-style: initial;
    color: #ee41b4;
    color: #0000FF;
}

@media (prefers-color-scheme: dark) {
    html {
        background-color: #212121;
        color: #F5F5F5;
        background-color: #181818;
        color: #f7f7f7;
    }

    a{
        color:#438cff;
    }
    a:visited {
        color:#438cff;
    }
}

</style>

M include/stdnav.html => include/stdnav.html +0 -1
@@ 5,7 5,6 @@
        <a href="/">root</a> |
        <a href="/macroblog/index.html">macroblog</a> |
        <a href="/microblog.html">microblog</a> |
        <a href="/review/index.html">review</a> |
        <a href="/seealso.html">see also</a> |
        <a href="/colophon.html">colophon</a>
    </nav>

M index.html => index.html +1 -1
@@ 17,7 17,7 @@
                I'm currently in my exam year of highschool
                (<abbr title="(Dutch) Pre-university Physics/Biology">VWO-NT/NG</abbr>).
                However, this hasn't stopped me from <a href="/microblog.html">shitposting on main</a>, <a href="/macroblog/index.html">vagueposting on main</a>,
                and <a href="/review/index.html">livetweeting about the latest game/series/<span title="in american that's movie">film</span></a> i've watched.
                and other <a href="/seealso.html">miscellaneous ways to not study</a>.
            </p>

            <p>

M macroblog/kethel2.html => macroblog/kethel2.html +23 -18
@@ 14,35 14,39 @@
                So, what language is the most portable, has universal support across linux distributions?
                <code>ISO/IEC 9899:1999</code>, or <em>The C Programming Language</em> - of course!
            </p>
           <h2>a small note of advice</h2>
            <p>
                Kethel isn't a perfect SSG by any means; it sometimes just writes garbled data to the output HTML fil
                Kethel isn't perfect by any means; it sometimes just writes garbled data to the output HTML document
                if a template or TSV ends with a newline, is probably vulnerable to several buffer overflow attacks,
                as no bounds checking is implemented at all for the templates, and treats HTML as plain text, with only a
                <code>strncmp</code> "parser". Yet, it still works! <br />
                So, I'd like to explain some design decisions behind Kethel/2, and convince YOU to use less CSS in your website!
                as no bounds checking is implemented at all, treats HTML as plain text, with only a
                "parser" which breaks if you change any nearly any formatting in the templates. And yet, it still works! <br />
                So, I'd like to explain some design decisions behind Kethel/2, for fun and to break-even on the time spent on
                this.
            </p>
            <h2><code>aggregate</code>, and my "solution" to index page generation</h2>
            <p>
                Aggregate was the 2nd program I wrote for my site, which fills the spot of a 'compiler', if we're following
                the compiler/linker metaphor. The RSS feed generation for my site before was really iffy
                (<a href="https://www.rfc-editor.org/info/rfc822/">RFC822</a> and <a href="https://www.rfc-editor.org/info/rfc2822/">RFC2822</a> are to blame).
                I could definitely have switched to atom feeds instead of RSS in the original kethel, but i had better things to do with my time then
                I <em>could</em> have switched to atom feeds instead of RSS in the original kethel, but I had better things to do with my time then
                refactor all my elixir code.
                <span>(this isnt an issue with elixir per se, but moreso that i didnt really wanna debug MY code every time i wanted to make a change
                    to my site, architecturally kethel1 kinda sucked)</span>
                <span>(This isn't an issue with elixir per se, but moreso that I didnt really wanna debug my elixir, wrote as my first and only elixir project)</span>
            </p>
            <p>
               The general idea with aggregate is that you provide a TSV file, with some free-form data, and aggregate could transform that into an index page,
               but also an atom <code>&lt;entry&gt;</code>, with proper tag uri support. Coming back to the first sentence about the 'compiler' metaphor,
               aggregate does not generate the final html, but only take the TSV and generate a <code>mkpage</code>-compatible 'object page'. Since I've
               only used C in this project, I already had an obj folder for intermediate output, so it was easy to just generate all the indexes, and
               various feed entries, and use <code>mkpage</code> as an <em>ersatz</em>-linker, to generate the final XML/HTML.
               but also an Atom <code>&lt;entry&gt;</code>, with proper tag uri support. Coming back to the first sentence about the 'compiler' metaphor,
               aggregate does not generate the final html, but only 'preprocesses' the templates and generates a <code>mkpage</code>-compatible 'object page'.

               Since I've only used C in this project, I already had an obj folder for intermediate output, so it was easy to just generate all the indexes, and
               various feed entries, and use <code>mkpage</code> as a sort of <em>ersatz</em>-linker, to generate the final XML/HTML.
            </p>

            <h2>So, what is this <code>mkpage</code> all about then?</h2>
            <p>
                mkpage is the original program that orchestrated all HTML generation, inspired by PHP's "it's just html!" approach, and
                <a href="https://zed.dev/">my code editors</a> unwillingness to let me use unclosed tags in a template file. I chose to use simple HTML comments
                with some meaning, which I then decode in C.
                Mkpage is the original program that orchestrated all HTML generation, inspired by PHP's "it's just html!" approach, and
                <a href="https://zed.dev/">my code editor's</a> unwillingness to let me use unclosed tags in my template html files. I chose to use simple HTML comments
                with some meaning, which I then decode in C. Originally an experiment to only generate my homepage, it's been able to generate a lot of my pages
                relatively quickly.
            </p>
            <p>
                However, it quickly become clear that my linear-time no-seek approach to page generation wasnt really going to scale to, say,


@@ 51,8 55,9 @@
                <code>STAMP</code> is used mostly for atom feed generation, but is generalised to work in most cases where you'd need a timestamp.
            </p>
            <p>
                Therefore, aggregate deals with most of the more complex parts of my websites build pipeline.
                Aggregate supports a lot more commands, compared to mkpage.
                Therefore, aggregate deals with most of the more complex parts of my website's build pipeline. A combination of some hardcoded behaviour (C
                lets you get away with way worse software architecture than elixir), and some generalised 'paradigms', has let me create this entire website with only 7 commands.
                Aggregate takes care of most of the more complicated commands, listed below.
            </p>
            <ul>
                <li><code>ANCHOR</code> - generates a reproducible id for any content-item, another issue i was dealing with in kethel2 </li>


@@ 63,8 68,8 @@
            </ul>
            <h2>So that's it, honestly</h2>
            <p>
                Besides some dependency modelling in make, this is all that Kethel2 comes with. I hope that you find some inspiration
                in my architectural choices here, and if not, i'll still keep enjoying my sub-halfsecond build times.
                Besides some dependency modelling in make, this is all that Kethel2 really needs. The only things I'd maybe want to change (or create, for funsies).

            </p>
            <figure>
                <blockquote><em>Merci d'avoir lu!</em></blockquote>

M microblog/index.html => microblog/index.html +4 -1
@@ 9,7 9,10 @@
<!--LOAD include/stdnav.html -->
        <main>
            <h1>microblog :3</h1>
            <p>i have no twitter and i must post, please subscribe to my atom feed :)</p>
            <p>
                i miss twitter honestly
            </p>
            <hr />
<!-- PUT -->
        </main>
<!--LOAD include/stdfooter.html -->

M microblog/item.html => microblog/item.html +1 -1
@@ 4,7 4,7 @@
</blockquote>
<figcaption>
<!-- PUT 2 -->
at
 at
<!-- DATE -->
</figcaption>
</figure>

M seealso.html => seealso.html +19 -8
@@ 4,12 4,12 @@
<!--LOAD include/stdhead.html -->
        <title>other links - m1kadev.nl</title>
        <style>
main>div {
    display: flex;
    width: max-content;
    gap: .5em;
}

        main>div {
            display: flex;
            width: max-content;
            gap: .5em;
        }

        </style>
    </head>


@@ 17,19 17,30 @@ main>div {
    <body>
<!--LOAD include/stdnav.html -->
        <main>
            <h1>See also !!</h1>
            <h1>Further reading!</h1>
            <div>
                <section>
                    <h2>meee :3</h2>
                    <ul>
                        <li>my <a href="https://letterboxd.com/m1kadev/">letterboxd</a></li>
                        <li>
                            my <a href="https://letterboxd.com/m1kadev/">letterboxd</a>
                            <ul>
                                <li><a href="https://letterboxd.com/m1kadev/diary/">diary</a></li>
                                <li><a href="https://letterboxd.com/m1kadev/watchlist/">watchlist</a></li>
                            </ul>
                        </li>
                        <li><a href="https://src.m1kadev.nl/">my sourcehut instance</a></li>
                    </ul>
                </section>
                <hr />
                <section>
                    <h2>others</h2>
                    <h3>Cool technical blogs/channels</h3>
                    <ul>
                        <li>my <a href="https://letterboxd.com/m1kadev/">letterboxd</a></li>
                        <li><a href="https://fasterthanli.me/">amos wegner (rust)</a></li>
                        <hr />
                        <li><a href="https://www.youtube.com/@Acerola_t">acerola - (shaders, graphics)</a></li>
                        <li><a href="https://www.youtube.com/@FUNKe">FUNKe - analysis and i like the art style </a></li>
                    </ul>
                </section>
            </div>