feat(web/blog): add ability to specify post author
Anyone is free to pen a post for tvl.fyi if they want, so being able to attribute the author might be useful. This wasn't originally a feature because I wrote //web/blog only for tazj.in initially. Change-Id: Ibc50b53f92113a82a53ce40bb5defa18e926cc10 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6560 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
parent
e726df8dc5
commit
7fd7a4465b
3 changed files with 6 additions and 0 deletions
|
@ -24,6 +24,9 @@ let
|
||||||
# Path to the Markdown file containing the post content.
|
# Path to the Markdown file containing the post content.
|
||||||
content = path;
|
content = path;
|
||||||
|
|
||||||
|
# Optional name of the author to display.
|
||||||
|
author = option string;
|
||||||
|
|
||||||
# Should this post be included in the index? (defaults to true)
|
# Should this post be included in the index? (defaults to true)
|
||||||
listed = option bool;
|
listed = option bool;
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ let
|
||||||
then ''date --date="@${toString post.updated}" '+ (updated %Y-%m-%d)' >> $out''
|
then ''date --date="@${toString post.updated}" '+ (updated %Y-%m-%d)' >> $out''
|
||||||
else ""
|
else ""
|
||||||
}
|
}
|
||||||
|
${if post ? author then "echo ' by ${post.author}' >> $out" else ""}
|
||||||
echo '</aside>' >> $out
|
echo '</aside>' >> $out
|
||||||
|
|
||||||
${
|
${
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
title = "Tvix: We are rewriting Nix";
|
title = "Tvix: We are rewriting Nix";
|
||||||
date = 1638381387;
|
date = 1638381387;
|
||||||
content = ./rewriting-nix.md;
|
content = ./rewriting-nix.md;
|
||||||
|
author = "tazjin";
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
title = "Tvix Status - September '22";
|
title = "Tvix Status - September '22";
|
||||||
date = 1662995534;
|
date = 1662995534;
|
||||||
content = ./tvix-status-202209.md;
|
content = ./tvix-status-202209.md;
|
||||||
|
author = "tazjin";
|
||||||
draft = true;
|
draft = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue