nix static site gen feat markdoll
Find a file
2025-04-22 12:08:25 -07:00
examples/quickstart plugins can have dependencies 2025-04-22 12:08:25 -07:00
pkgs plugins can have dependencies 2025-04-22 12:08:25 -07:00
.gitignore working this time 2025-04-21 18:10:13 -07:00
default.nix init 2025-04-21 17:24:14 -07:00
flake.lock plugin support 2025-04-22 11:18:59 -07:00
flake.nix init 2025-04-21 17:24:14 -07:00
README.md readme update 2025-04-21 19:26:07 -07:00

Teapot

because doll. it uses markdoll.

Usage

this is a nix package/flakey thing, the package outputs a normal directory/derivation so awawa

it currently does not support non-flake, but could.

step 1: make the nix package!

basically, make a package that do this (there's like 8 ways to do this please be careful)

brewTea {
  name = "doll site";
  src = ./.;

  layoutSrc = ./layouts;
  defaultLayout = ./layouts/default.html;
};

step 2: make the default layout!

here's a good layouts/default.html to start with..

<!DOCTYPE html public "awawawawa">
<html>
  <head>
    <meta charset="utf-8" />
    <title>%%TITLE%%:doll</title>
    %%HEAD%%
    <style>
      body {
        background-color: #0a0103;
        color: #c24444;
        font-family: system-ui;
      }
    </style>
  </head>
  <body>
    <main>%%CONTENT%%</main>
  </body>
</html>

step 2a: what the %%%% do

the layout engine knows three keywords:

  • %%TITLE%% which comes from either the filename (so index.doll -> index) or the frontmatter title key (what is a frontmatter? skip to step 3a)
  • %%HEAD%% which is filled in by the following frontmatter keys:
    • description becomes a meta:description tag
    • tags becomes a meta:keywords tag
    • author becomes a meta:author tag
  • %%CONTENT%% becomes the markdoll content

step 3: make MARKDOLL!!!!!

ok so lets just put something basic into index.doll

&hello everydolly!
	awawawawawa

  [img(https://codeberg.org/0x57e11a/markdoll/raw/branch/main/button.png)::
		alt text goes here (88x31 button that says MADE WITH MARKDOLL)
	]

step 3a: make FRONTMATTER!!

(this is a weird word dw about it its actually some cool stuff)

so we can add some details aboput every markdoll file,, lets add everything we support!!

---
title: doll!!! points!
description: dolldolldolldolldolldolldolldoll
tags: no witches allowed, maybe if She brings tea tho
author: aki.41666
layout: default.html
---
&hello everydolly!
	awawawawawa

	[img(https://codeberg.org/0x57e11a/markdoll/raw/branch/main/button.png)::
		alt text goes here (88x31 button that says MADE WITH MARKDOLL)
	]

its the stuff between the --- and --- thing

is IS NOT YAML

do NOT yaml this. it is key: value and value is a string

no exceptions!!!!!!!!!

step 3b: make another layout

so we can add more layouts to layouts/ folder, maybe have one for the smart sysmate and one for the silly sysmate

and switch between them using layout in frontmatter

so together,

layouts/aki.html

<!DOCTYPE html public "awawawawa">
<html>
  <head>
    <meta charset="utf-8" />
    <title>%%TITLE%%:doll/aki</title>
    %%HEAD%%
    <style>
      body {
        background-color: #0a0103;
        color: rgb(225, 0, 255);
        font-family: system-ui;
      }
    </style>
  </head>
  <body>
    <nav>aki!!!!!!!!!</nav>
    <main>%%CONTENT%%</main>
  </body>
</html>

and then a simple aki.doll

---
title: hi it is
layout: aki.html
---
&its aki!!!!!!!!!
	awawa

this will produce a different output containing 100% more aki

step 4: build it (n stuff)

the easiest way to just output stuff is

nix build . # if using flakes
nix-build # if not

# to look at it
nix-shell -p python3 --command "python -m http.server -d result"

and open http://localhost:8000