fix(wpcarro/blog): Fix broken post links
TL;DR: - copy rendered posts to $out/posts - update postUrl attr - remove unused attrs Change-Id: I027c20d6244e4626128788ad9aa1f1aad7855f32 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4723 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
This commit is contained in:
parent
e107311cb8
commit
c05c6920ee
2 changed files with 7 additions and 10 deletions
|
@ -34,15 +34,12 @@ let
|
||||||
|
|
||||||
toPostHtml = post: readFile (pkgs.substituteAll {
|
toPostHtml = post: readFile (pkgs.substituteAll {
|
||||||
src = ./fragments/post.html;
|
src = ./fragments/post.html;
|
||||||
postUrl = "${config.baseUrl}/${post.key}.html";
|
postUrl = "${config.baseUrl}/posts/${post.key}.html";
|
||||||
postTitle = post.title;
|
postTitle = post.title;
|
||||||
postDate = formatDate post.date;
|
postDate = formatDate post.date;
|
||||||
});
|
});
|
||||||
in {
|
in pkgs.runCommandNoCC "wpcarros-blog" {} ''
|
||||||
inherit posts rendered config;
|
|
||||||
|
|
||||||
root = pkgs.runCommandNoCC "wpcarros-blog" {} ''
|
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp ${wpcarro.website.render postsHtml} $out/index.html
|
cp ${wpcarro.website.render postsHtml} $out/index.html
|
||||||
'';
|
cp -r ${rendered} $out/posts
|
||||||
}
|
''
|
||||||
|
|
|
@ -22,6 +22,6 @@ in {
|
||||||
cp -r ${wpcarro.website.habit-screens} $out/habits/index.html
|
cp -r ${wpcarro.website.habit-screens} $out/habits/index.html
|
||||||
|
|
||||||
# /blog
|
# /blog
|
||||||
cp -r ${wpcarro.website.blog.root} $out/blog
|
cp -r ${wpcarro.website.blog} $out/blog
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue