Skip to content

thecsw/darkness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

I love Darkness 🥬

darkness

Go Report Card GoDoc PRs Welcome

Motivation

I have been writing and maintaining my website for more than five years! Asciidoctor was a nice way to bootstrap quick and good-looking web pages in a matter of minutes. However, my desire for quirky designs and math support, made the issue of bulding it annoyingly complicated. I just want a nice website that can do anything.

Darkness

It is my honor and pleasure to introduce you to Darkness. The most noble static website generator. To keep the long story short, check out my current website, which is dutifully built by Darkness.

She supports all org mode (and markdown!) formatting, native flex galleries (with automatic blurry previews generations and lazy loading!), full math support, social embeds (youtube, spotify, etc.), drop caps (they look fancy), automatic code highlighting, and much more 😈

Also, did I tell you it's super fast?

Performance

sandyuraz:source λ darkness build
Processed 128 files in 112 ms
farewell

Each page takes <1ms to process on my 2020 M1 MacBook Pro. With all the IO time included as well. Heavily optimized with komi pools, hunting heap moves, and heavy profiling.

You can play with best performance by tuning parallelization parameters with -workers N, and other flags you can use by calling darkness -help!

Here is a benchmark with hyperfine on the same config as above,

sandyuraz:source λ hyperfine "darkness build"
Benchmark 1: darkness build
  Time (mean ± σ):     112.3 ms ±   6.6 ms    [User: 413.7 ms, System: 92.3 ms]
  Range (min … max):   103.1 ms … 124.3 ms    26 runs

How to get it

It's simple! If you have go1.22 installed, you can install it through go tool with

go install -v github.com/thecsw/darkness/v3@v3.0.2

Or you can also grab pre-built binaries from the releases page.

Building your Darkness website

Darkness and I provide you with a template website that you can get a copy of through the binary! Run the below, which will create a new directory, for example, here called ishmael,

darkness new ishmael

Go and run the website locally with darkness serve and explore Darkness in action!

Here is the web version of ishmael to browse around!

Okay, go, go! I'll see you later 😘