2021-05-12 16:00:39 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
{ # content of the <title> tag
|
|
|
|
title
|
|
|
|
# main part of the page, usually wrapped with <main>
|
|
|
|
, content
|
|
|
|
# optional extra html to inject into <head>
|
|
|
|
, extraHead ? null
|
|
|
|
# whether to use global URLs instead of absolute paths
|
|
|
|
, useUrls ? false
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
let
|
2021-05-12 16:41:51 +02:00
|
|
|
inherit (pkgs) runCommandNoCC lib;
|
|
|
|
inherit (depot.tools) cheddar;
|
2021-05-12 16:00:39 +02:00
|
|
|
|
|
|
|
baseUrl = lib.optionalString useUrls "https://tvl.fyi";
|
|
|
|
in
|
|
|
|
|
2021-05-12 16:41:51 +02:00
|
|
|
runCommandNoCC "index.html" {
|
|
|
|
headerPart = ''
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
<meta name="description" content="The Virus Lounge">
|
2021-08-26 22:53:11 +02:00
|
|
|
<link rel="stylesheet" type="text/css" href="${baseUrl}/static/tvl.css" media="all">
|
2021-05-12 16:41:51 +02:00
|
|
|
<link rel="icon" type="image/webp" href="${baseUrl}/static/favicon.webp">
|
|
|
|
<title>${title}</title>
|
|
|
|
'' + lib.optionalString (args ? extraHead) extraHead + ''
|
|
|
|
</head>
|
|
|
|
<body class="light">
|
|
|
|
'';
|
2021-05-12 16:00:39 +02:00
|
|
|
|
2021-05-12 16:41:51 +02:00
|
|
|
inherit content;
|
2021-05-12 16:00:39 +02:00
|
|
|
|
2021-05-12 16:41:51 +02:00
|
|
|
footerPart = ''
|
2021-05-12 16:00:39 +02:00
|
|
|
<hr>
|
|
|
|
<footer>
|
|
|
|
<p class="footer">
|
2021-05-12 17:27:02 +02:00
|
|
|
<a class="uncoloured-link" href="https://at.tvl.fyi/?q=%2F%2FREADME.md">code</a>
|
2021-05-12 16:00:39 +02:00
|
|
|
|
|
|
|
|
<a class="uncoloured-link" href="https://cl.tvl.fyi/">reviews</a>
|
|
|
|
|
|
2021-09-15 14:22:10 +02:00
|
|
|
<a class="uncoloured-link" href="https://tvl.fyi/builds">ci</a>
|
|
|
|
|
|
2021-05-12 16:00:39 +02:00
|
|
|
<a class="uncoloured-link" href="https://b.tvl.fyi/">bugs</a>
|
|
|
|
|
|
|
|
|
<a class="uncoloured-link" href="https://todo.tvl.fyi/">todos</a>
|
2021-05-12 16:07:50 +02:00
|
|
|
|
|
|
|
|
<a class="uncoloured-link" href="https://atward.tvl.fyi/">search</a>
|
2021-05-12 16:00:39 +02:00
|
|
|
</p>
|
|
|
|
<p class="lod">ಠ_ಠ</p>
|
|
|
|
</footer>
|
|
|
|
</body>
|
2021-05-12 16:41:51 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
passAsFile = [ "headerPart" "content" "footerPart" ];
|
|
|
|
} ''
|
|
|
|
${cheddar}/bin/cheddar --about-filter content.md < $contentPath > rendered.html
|
|
|
|
cat $headerPartPath rendered.html $footerPartPath > $out
|
|
|
|
''
|