From 57dd023d9ff80bfcaab93931a48402c276fc8bd9 Mon Sep 17 00:00:00 2001 From: derpyzza Date: Mon, 28 Oct 2024 17:07:40 +0500 Subject: [PATCH] Adds footnote + table of contents generation --- assets/index_template.html | 7 +- assets/main.css | 88 ++-- assets/template.html | 30 +- design.html | 51 ++- index.html | 3 +- jenny | 1 - jenny.py | 376 ++++++++++++++++++ public/220510-about-jenny.html | 60 +-- .../230512-hacky-script-perfect-script.html | 47 +-- ...ems-evolved-from-material-limitations.html | 30 +- public/240116-star-wars-visions-season-2.html | 56 +-- public/240525-on-writing.html | 33 +- public/archive.html | 9 +- src/220510-about-jenny.md | 21 +- src/230512-hacky-script-perfect-script.md | 12 +- src/240525-on-writing.md | 6 +- 16 files changed, 538 insertions(+), 292 deletions(-) delete mode 160000 jenny create mode 100755 jenny.py diff --git a/assets/index_template.html b/assets/index_template.html index b078874..3183d11 100644 --- a/assets/index_template.html +++ b/assets/index_template.html @@ -22,7 +22,7 @@
home / - archive + archive / github
@@ -33,7 +33,6 @@

{{title}}

- {{content}}
- - + \ No newline at end of file diff --git a/index.html b/index.html index f90a7ce..e5bbed0 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@
home / - archive + archive / github
@@ -58,7 +58,6 @@ diff --git a/src/220510-about-jenny.md b/src/220510-about-jenny.md index 0fdbee7..bfdac46 100644 --- a/src/220510-about-jenny.md +++ b/src/220510-about-jenny.md @@ -3,7 +3,7 @@ @post_date 2022.05.10 --- -
+

Notice

This post is pretty old. It was written for an older version of this site, which @@ -17,7 +17,7 @@ But that's alright.
-## Jenny +# Jenny i've been wanting to start a small blog to kinda document my projects and stuff for a while now, and a couple days ago i decided to just sit down and finally make one. going into it however, i had some requirements i needed to satisfy: - the site needed to be lightweight. like *really* lightweight. like fits-in-under-512-kb-so-i-can-join-the-[512kb-club][1] lightweight. @@ -26,19 +26,16 @@ i've been wanting to start a small blog to kinda document my projects and stuff - no fancy databases. each post would just be a separate html file. - free and open source. - - essentially, i wanted a very minimal setup. i write a post, post appears on my website. simple. before writing jenny i tried out [jekyll][2], and while jekyll sort of ticked off all my requirements, i still didn't like it too much. the main reason was because i didn't really understand how it worked too well, and i really did not want to sit down and read the documentation for it ( im lazy ). -so as a fix for my problems, i just wrote jenny :D +so as a fix for my problems, i just wrote jenny :D [jenny is derived from the word 'generator'. as in, 'jenny-rator'. i uwu-fied it kinda ig](_) -## What - -is jenny? jenny, is a small, super opinionated static site generator. +# What +is jenny? jenny, is a small, super opinionated [opinionated as in i was too lazy to add any sort of user friendly features for anyone that isn't me](_) static site generator. it reads in every .md file from a src/ directory, translates them to a .html with the help of a template .html file which tells the script how to generate the output files, and places them into a public/ directory. this way, i can just write all my posts in markdown (which is essentially just plain text with extra features), and have the script turn my posts to a web friendly format for others like you to see! -## Why +# Why would you write your own static site generator? why not use a different one like hugo or something if you didn't like jekyll? why not just simply write your posts in html? well, those are all perfectly valid questions. the real reason i wrote my own static site generator instead of just searching for a better one to use ( there's like [billions][3] of them ) is primarily because it sounded like an interesting project. it's functionally very simple, you can extend it as much as you want, and it's quite a useful tool, so writing my own was loads more fun and educational than using someone @@ -46,7 +43,7 @@ else's project. if however, you do not care about all that stuff and just want a for writing my posts in html, while it's a perfectly acceptable way to write a blog, it's frankly quite a chore. so writing my own generator sounded a seemed to be the best way to get exactly what i wanted :) -## How +# How does it really work? ( as of the time of writing ) jenny is essentially just a small python script that expects three things: a src/ directory that contains .md files, an assets/ directory that contains a stylesheet and two template .html files ( one for the main page, and one for the actual posts themselves ) and a public directory. the script reads through every .md file in the src/ directory, and first off preprocesses the file for some metadata. metadata for jenny follows the following syntax: ``` @@ -56,7 +53,7 @@ metadata must always begin with a dollar symbol, immediately followed by a comma command. currently, jenny only supports three commands: title, subtitle, and data. all three of these are used in displaying the title of the post on the post page, as well as displaying the title on the main page. after the preprocessing stage, jenny converts the raw markdown posts to a .html page using the aforementioned template files, and stores the post to a list of posts along with their titles, subtitles, and dates. jenny then just takes all that data, and feeds it through another template to produce an index file as the landing page of the blog. and... that's it! jenny is in itself a super basic script. it only does what it needs to, and nothing else. it ends up being slightly not user friendly as a direct cause of that simplicity sometimes, but that's my fault for just rushing the implementation a bit hehe. -## Final notes +# Final notes so, that's jenny! jenny was quite fun to work on, and most importantly, jenny is a very useful tool for me personally, which really makes all the html and css i had to write worth it in the end. as of writing this, jenny is still missing a couple features that i would like to add, namely some nice configuration features to make setting up a blog easier, as well as a checker thing that only updates the files that have been recently edited. i plan to write a blog post a week and my blog folder will really start filling up quickly, and i dont want to sit there waiting for python to try and format all the scripts. i'd like to quickly thank [bob nystrom][4], and [kenton hamaluik][5] for their lovely static site generators, which i used as reference. go check them out, they were really helpful! @@ -66,4 +63,4 @@ this is my first ever blog post, so sorry for the monotonous tone. it'll definit [2]:https://jekyllrb.com/ [3]:https://jamstack.org/generators/ [4]:https://github.com/munificent/game-programming-patterns -[5]:https://github.com/hamaluik/blog.hamaluik.ca \ No newline at end of file +[5]:https://github.com/hamaluik/blog.hamaluik.ca diff --git a/src/230512-hacky-script-perfect-script.md b/src/230512-hacky-script-perfect-script.md index 71883b7..5ffe8b5 100644 --- a/src/230512-hacky-script-perfect-script.md +++ b/src/230512-hacky-script-perfect-script.md @@ -4,7 +4,7 @@ --- Back in 2022 i decided to start a tiny little personal blog. i designed a lightweight website, and spun up a -quick little python script that acted as a static site generator [1] where i wrote my blogposts in markdown in a source folder somewhere, and my script then translated them into html files with the help of predefined templates. that blog only lasted one blogpost before i abandoned it / forgot about it. +quick little python script that acted as a static site generator [I named it jenny!](_) where i wrote my blogposts in markdown in a source folder somewhere, and my script then translated them into html files with the help of predefined templates. that blog only lasted one blogpost before i abandoned it / forgot about it. Fast forward to april 2023. i started cutting out social media from my devices, and consuming a lot more medium-to-long-form-content, like books and blogs, which made me want to re-start my blog. there was, however, a problem with my old setup: my beloved little python script ***sucked***. it was a tiny hacky terribly-slow little script designed solely to work on that specific website with that specific design, with no error handling, no configuration ability, no nothing! @@ -31,7 +31,7 @@ I abandoned the go generator (surprise surprise), and that is when i started my ## The inevitability of jenny -After struggling with fennel one day [2], i wandered over to my original python repo. i decided to either use jenny, or some popular static site generator [3] to atleast get a blog up and running while i messed around with my better-stronger-faster-one-ssg-to-rule-them-all-ssg. +After struggling with fennel one day [I wanted to write a custom markdown parser, along with a lisp-based templating language in fennel](_), i wandered over to my original python repo. i decided to either use jenny, or some popular static site generator [But but my customization!! my minimalism!! noooooooooooo](_) to atleast get a blog up and running while i messed around with my better-stronger-faster-one-ssg-to-rule-them-all-ssg. I went ahead and pulled down the original jenny repo, and quickly tweaked it so that it was a tiny hacky terribly-slow little script designed solely to work on this specific website with this specific design, with no error handling, no configuration ability, no nothing. @@ -42,11 +42,5 @@ It worked pretty well. i was able to get my website up and running, the way i wa So perhaps i did not in fact need a super high powered ultra mega minimal exciting perfect static site generator to rule them all that will be done soon™. perhaps all i needed was a hacky little python script i wrote one year ago that works perfectly fine, right now. * * * - -[1] I named it jenny! - -[2] I wanted to write a custom markdown parser, along with a lisp-based templating language in fennel - -[3] But but my customization!! my minimalism!! noooooooooooo - + *i still am going to make my ultra minimal mega static site generator sometime soon tho. err maybe.* diff --git a/src/240525-on-writing.md b/src/240525-on-writing.md index c3db037..ce69a83 100644 --- a/src/240525-on-writing.md +++ b/src/240525-on-writing.md @@ -4,7 +4,7 @@ --- -hello writing writing i am writing [1] +hello writing writing i am writing [ i was bored one day so i decided to write something. Not knowing what to write, i just started vomitting words on the page. This is what came out, unedited ( or mostly unedited ).](_) people should write more often, @@ -36,6 +36,4 @@ However that isn't the point, what i want to talk about is just how impossible i Although i doubt most scholars tried to master a billion subjects at once, they only specialized in a handful of subjects and aimed for a high quality of knowledge over a high quantity. -Perhaps that is what we should aim for too. - -[1] i was bored one day so i decided to write something. Not knowing what to write, i just started vomitting words on the page. This is what came out, unedited ( or mostly unedited ). \ No newline at end of file +Perhaps that is what we should aim for too. \ No newline at end of file