chore(wpcarro/website): Templatize website
Preferring billandhiscomputer.com in lieu of wpcarro.dev. wpcarro is a bit of a tough username for others to remember and for me to say out-loud (it usually involves me spelling it and explaining to others why Carroll is missing 2x-Ls). I think it's time for a change. During the transition, I don't want to deal with stale links to https://wpcarro.dev, so I'm templatizing more of my website and blog so that these values can be replaced. Expect more forthcoming changes. Change-Id: Ic2f5519e6b0d76fcb8b737bf50009e8388f1b178 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4754 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
parent
44f20ea810
commit
ca6be786a1
5 changed files with 44 additions and 31 deletions
|
|
@ -4,18 +4,33 @@ let
|
|||
inherit (builtins) readFile;
|
||||
inherit (depot.users) wpcarro;
|
||||
|
||||
render = contentHtml: pkgs.substituteAll {
|
||||
domain = "billandhiscomputer.com";
|
||||
|
||||
globalVars = {
|
||||
inherit domain;
|
||||
homepage = "https://${domain}/";
|
||||
blog = "https://${domain}/blog";
|
||||
habits = "https://${domain}/habits";
|
||||
github = "https://github.com/wpcarro";
|
||||
linkedin = "https://linkedin.com/in/williampatrickcarroll";
|
||||
depotWork = "https://cs.tvl.fyi/depot/-/blob/users/wpcarro";
|
||||
};
|
||||
|
||||
renderTemplate = src: vars: pkgs.substituteAll (globalVars // vars // {
|
||||
inherit src;
|
||||
});
|
||||
|
||||
withBrand = contentHtml: renderTemplate ./fragments/template.html {
|
||||
inherit contentHtml;
|
||||
src = ./fragments/template.html;
|
||||
};
|
||||
in {
|
||||
inherit render;
|
||||
inherit domain renderTemplate withBrand;
|
||||
|
||||
root = pkgs.runCommandNoCC "wpcarro.dev" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
# /
|
||||
cp ${render (readFile ./fragments/homepage.html)} $out/index.html
|
||||
cp ${withBrand (readFile (renderTemplate ./fragments/homepage.html {}))} $out/index.html
|
||||
|
||||
# /habits
|
||||
mkdir -p $out/habits
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue