2024 eclipse timelapse by Ashley Lian

Astrea — Python-based static site generator

Astrea is a custom static site generator meant to ease the experience of desgining of one's own Digital Garden. With Astrea you may write pages using the precision of HTML while also taking care of the headers and footers of the website file, keeping them consistent site-wide. When a new page is added, Astrea automatically handles its addition, logging it in every other page's navigation bar under its appropriate category by parsing a customizable pre-header. This functionality was the impetus for creating Astrea, as I found myself dreading learning anything new because it meant I would have to add a new page to my site which meant manually editing the nav bars of a dozen other pages. And so, I built this tool to do it for me!

Astrea can be can be used for free by anyone in an unlimited capacity — Github Link

I am of the opinion that the best and most meaningful personal blogs are born out of simplicity. In this spirit, I designed my this website manager which forces me to be creative given a set of simple and restrictive rules, resulting in a relatively extensive website with no Javascript whatsoever. I am exceedingly impressed by what I can do with html and css that I write by hand rather than what I can build using a paid website service. In addition, because Astrean websites are barebones, they require the minimum amount of hardware capabilities on a visitor's end, so your website can be easily viewed by anyone anywhere. A follow-up project that sprouted from the same philosophical flavor is my micro browser BISCUIT. I encourage others to give BISCUIT and Astrea a try. Discover what you can make when you have full control over your website/blog/digital garden.

    astrea/
        |
        ├── inc/
        |   ├── contains .htm formatted files
        ├── site/
        |   ├── main.py writes final .html files here
        ├── links/
        |   ├── .css and other theming files
        ├── media/
        |   └── images and other files
        |
        ├── index.html
        ├── 404.html
        ├── main.py
        └── build.sh
    

Astrea works by first detecting the .htm files within the inc/ folder, making a catalogue of them and their category. Each file's category is defined within the file itself between the --- markers. Astrea detects all unique occurrences of a category and determines the membership of all files. Astrea then parses the .htm files. The .htm format requires users to write, in HTML, all of the file contents within the <main> element. Astrea appends text requirements for the HTML format including the navigation bar which contains all file categories and links to the other site files. Finally, a <footer> is added to each file. The post-processsed files are saved in site/. The result are fully functional webpages with the ability to navigate to and from each page. In this sense, a website built with Astrea is a mighty, highly customizable skeleton, and the muscle and fat and pretty bits can be slathered on after the fact with .css magic.

Mess around with this! Add your own files, change up the `home.html` landing page, fiddle with `links/main.css` to create your own styling. You'll probably want to change the places where my name is referenced directly or links to places that don't exist.

If you have any questions please let me know! If you have any optimizations/suggestions for the code, let me know too or make your own pull requests! I've cobbled this together in 1 hour spurts over 2 weeks, all while being fried after work so it's guaranteed that much of this code is less than optimal. Lastly, have fun! I'm excited to see what you come up with using Astrea.