about summary refs log tree commit diff
path: root/web
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2021-11-05T12·41+0100
committertazjin <mail@tazj.in>2021-11-05T12·51+0000
commit4baf633622bd75492ce1e62336c8c2c99c44e13d (patch)
treefac435ca3abad44c63a79e9ee23f34719342c2b3 /web
parent10e279ac13f3fe98cfd301dc38d54507740f9b86 (diff)
refactor(web/tvl/template): Move footer into a separate target r/3003
This makes it possible for the footer to be reused in other places,
e.g. when templating blog posts (which do not go through
//web/tvl/template (yet)).

Change-Id: Ia8ab0e1c6db4f76b4de49239e11a4474038f60ae
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3773
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'web')
-rw-r--r--web/tvl/footer/default.nix21
-rw-r--r--web/tvl/template/default.nix16
2 files changed, 22 insertions, 15 deletions
diff --git a/web/tvl/footer/default.nix b/web/tvl/footer/default.nix
new file mode 100644
index 000000000000..7412d019ee56
--- /dev/null
+++ b/web/tvl/footer/default.nix
@@ -0,0 +1,21 @@
+# Footer fragment for TVL homepages, used by //web/tvl/template for
+# our static pages and also via //web/blog for blog posts.
+{ lib, ... }:
+
+args: ''
+  <p class="footer">
+    <a class="uncoloured-link" href="https://at.tvl.fyi/?q=%2F%2FREADME.md">code</a>
+    |
+    <a class="uncoloured-link" href="https://cl.tvl.fyi/">reviews</a>
+    |
+    <a class="uncoloured-link" href="https://tvl.fyi/builds">ci</a>
+    |
+    <a class="uncoloured-link" href="https://b.tvl.fyi/">bugs</a>
+    |
+    <a class="uncoloured-link" href="https://todo.tvl.fyi/">todos</a>
+    |
+    <a class="uncoloured-link" href="https://atward.tvl.fyi/">search</a>
+    '' + lib.optionalString (args ? extraFooter) args.extraFooter + ''
+  </p>
+  <p class="lod">ಠ_ಠ</p>
+''
diff --git a/web/tvl/template/default.nix b/web/tvl/template/default.nix
index b91016c22f11..f33274f02edd 100644
--- a/web/tvl/template/default.nix
+++ b/web/tvl/template/default.nix
@@ -37,21 +37,7 @@ runCommandNoCC "index.html" {
   footerPart = ''
     <hr>
     <footer>
-      <p class="footer">
-        <a class="uncoloured-link" href="https://at.tvl.fyi/?q=%2F%2FREADME.md">code</a>
-        |
-        <a class="uncoloured-link" href="https://cl.tvl.fyi/">reviews</a>
-        |
-        <a class="uncoloured-link" href="https://tvl.fyi/builds">ci</a>
-        |
-        <a class="uncoloured-link" href="https://b.tvl.fyi/">bugs</a>
-        |
-        <a class="uncoloured-link" href="https://todo.tvl.fyi/">todos</a>
-        |
-        <a class="uncoloured-link" href="https://atward.tvl.fyi/">search</a>
-        '' + lib.optionalString (args ? extraFooter) extraFooter + ''
-      </p>
-      <p class="lod">ಠ_ಠ</p>
+      ${depot.web.tvl.footer args}
     </footer>
   </body>
   '';