refactor(wpcarro/blog): Prefer depot.web.blog
Hugo is a bit too heavyweight for my taste. Change-Id: I331bc5898bd40f1a03bbde8ad69fe3cc9f72c18b Reviewed-on: https://cl.tvl.fyi/c/depot/+/4704 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
21e1ae3e69
commit
bb72d16cce
41 changed files with 77 additions and 1119 deletions
|
|
@ -1,12 +1,27 @@
|
|||
{ pkgs, ... }:
|
||||
{ depot, lib, pkgs, ... }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "blog.wpcarro.dev";
|
||||
buildInputs = with pkgs; [ hugo ];
|
||||
src = builtins.path { path = ./.; name = "blog"; };
|
||||
buildPhase = ''
|
||||
with depot.nix.yants;
|
||||
|
||||
let
|
||||
inherit (builtins) hasAttr filter;
|
||||
inherit (depot.web.blog) post includePost renderPost;
|
||||
|
||||
config = {
|
||||
name = "wpcarro's blog";
|
||||
baseUrl = "https://blog.wpcarro.dev";
|
||||
footer = "";
|
||||
};
|
||||
|
||||
posts = filter includePost (list post (import ./posts.nix));
|
||||
|
||||
rendered = pkgs.runCommandNoCC "wpcarros-blog" {} ''
|
||||
mkdir -p $out
|
||||
${pkgs.hugo}/bin/hugo --minify --destination $out
|
||||
|
||||
${lib.concatStringsSep "\n" (map (post:
|
||||
"cp ${renderPost config post} $out/${post.key}.html"
|
||||
) posts)}
|
||||
'';
|
||||
dontInstall = true;
|
||||
|
||||
in {
|
||||
inherit posts rendered config;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue