feat(web/tvl): Add rendered graphviz graph to the page

This commit is contained in:
Vincent Ambo 2020-04-21 03:38:30 +01:00
parent 4683b24e14
commit 1faf44b3b3
2 changed files with 21 additions and 1 deletions

View file

@ -30,6 +30,7 @@ let
c-ares
cacert
cachix
cairo
cargo
cgit
clang_9
@ -48,16 +49,20 @@ let
fira
fira-code
fira-mono
fontconfig
freetype
gettext
glibc
gnutar
go
google-cloud-sdk
graphviz
grpc
gzip
haskell
iana-etc
imagemagickBig
jetbrains-mono
jq
kontemplate
lib

View file

@ -1,7 +1,13 @@
{ depot, pkgs, ... }:
let
inherit (pkgs) writeText runCommandNoCC;
inherit (pkgs) graphviz runCommandNoCC writeText;
tvlGraph = runCommandNoCC "tvl.png" {
nativeBuildInputs = with pkgs; [ fontconfig freetype cairo jetbrains-mono ];
} ''
${graphviz}/bin/neato -Tpng ${./tvl.dot} > $out
'';
homepage = writeText "index.html" ''
<!DOCTYPE html>
@ -43,6 +49,14 @@ let
<i>(Hope you've checked that it's open!)</i>
</p>
<hr>
<h2>Where did all these people come from?</h2>
<p>
It's pretty straightforward.
</p>
<img src="/static/tvl.png" alt="Who's who?">
<hr>
<footer>
<p class="footer">
@ -60,6 +74,7 @@ in runCommandNoCC "website" {} ''
mkdir -p $out/static
cp ${homepage} $out/index.html
cp -r ${./static}/* $out/static
cp ${tvlGraph} $out/static/tvl.png
# Some assets are stolen from the blog
cp ${depot.web.homepage}/static/jetbrains-* $out/static