# This file defines various fragments of the blog, such as the header # and footer, as functions that receive arguments to be templated into # them. # # An entire post is rendered by `renderPost`, which assembles the # fragments together in a runCommand execution. # # The post index is generated by //users/tazjin/homepage, not by this # code. { depot, lib, ... }: let inherit (builtins) filter map hasAttr replaceStrings; inherit (depot.third_party) runCommandNoCC writeText; inherit (depot.users.tazjin) renderMarkdown; # Generate a post list for all listed, non-draft posts. isDraft = post: (hasAttr "draft" post) && post.draft; isUnlisted = post: (hasAttr "listed" post) && !post.listed; escape = replaceStrings [ "<" ">" "&" "'" ] [ "<" ">" "&" "'" ]; header = title: ''
Note: This post is a draft! Please do not share the link to it without asking me first.
Note: This post is unlisted! Please do not share the link to it without asking me first.