Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/greghendershott/blog

Source for my blog
https://github.com/greghendershott/blog

blog racket

Last synced: about 1 month ago
JSON representation

Source for my blog

Awesome Lists containing this project

README

        

This is the source for my blog.

Although I developed -- and still intend to maintain -- [[https://github.com/greghendershott/frog][Frog]], I wanted to experiment with a different approach: Explode it into little pieces driven by a ~Makefile~.

My [[https://en.wikipedia.org/wiki/Greenspun's_tenth_rule][Greenspun's Tenth Rule]] riff: "Any sufficiently complicated static blog generator contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of ~make~." I can say that without being an asshole because I made one.

Premise: If you're a programmer, your blog generator need not have configuration, customization, or templates. If you want it to work differently, you can change the code.

* General
The heart of this is the ~Makefile~.

As with Frog, this uses two-stage, "compile and link" metaphor.

** "Compile"
- Blog post source files ~$(src)/posts/*.md~ are "compiled" into ~$(cache)/*.rktd~ files. These files have some meta-data plus an ~xexpr~ representing the body of the post (e.g. the ~~ element that will go in some containing page).
- Each post tag appends the ~.rktd~ pathname to a ~$(cache)/tags/{tag-name}~.
** "Link"
- Use ~$(cache)/*.rktd~ post bodies to generate complete ~.html~ post pages.
- Use ~$(cache)/tags/{tag-name}~ to generate feeds and index page for each tag.
- Generate ~$(src)/non-posts/*.md~.
- Generate ~sitemap.txt~.
- ~cp~ miscellaneous "assets" from ~$(src)/static/*~.
** Advantages
- Changes to the overall page (e.g. updating a copyright in the footer) can be done without rebuilding the posts from scratch. This particularly helps when the posts are enhanced with things like syntax highlighting and automatic links to Racket docs, which take a bit longer to do.
- As already mentioned, this allows a tags "database" to be made at the same time.

* TO-DO

** TODO Maybe stop depending on frog/{enhance-body paths}
- Split out from frog to new pkgs?
- Also, the pygmentize stuff for frog spawns a long-running python process, which makes frog faster, but won't help us (in fact it may hurt a little).

** TODO Maybe create new example repo named "tadpole"
- With whatever is left after doing the previous item.
- Replace my real ~src~ with some example content (e.g. from Frog).
- Share as a repo (not a package) in case anyone else wants to fork it and do what they want.