aboutsummaryrefslogtreecommitdiff
path: root/www/index.nix
blob: 607a005b089ebd70e69caacbfb029178c2b39cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ self, ... }:
{
  perSystem =
    { ... }:
    {
      websites.${self.domain} =
        { config, lib, ... }:
        let
          inherit (lib) mkOption types;
          replacements = {
            "@title@" = config.title;
            "@stylesheet@" = ''<link rel="stylesheet" type="text/css" href="style.css">'';
            "@head@" = ''
              <meta charset="utf-8" />
              <meta http-equiv="X-UA-Compatible" content="IE=edge" />
              <meta name="viewport" content="width=device-width">
              <meta name="description" content="Informationen zum Stadtteil Heimfeld und seinem Stadtteilbeirat">
              <meta name="keywords" content="Heimfeld, Stadtteil, Hamburg, Stadtteilbeirat, Beirat, Stadtteilfest, Treffpunkthaus">
              <link rel="shortcut icon" type="image/x-icon" href="/img/Kraniche-dreh-klein.gif">
              <script async src="redirects.js"></script>
            '';
          };
          replace = file: with lib; replaceStrings (attrNames replacements) (attrValues replacements) file;
        in
        {
          files =
            with lib;
            listToAttrs (
              map
                (path: rec {
                  name = baseNameOf path;
                  value = with builtins; toFile "index.html" (replace (readFile path));
                })
                [
                  ./html/index.html
                  ./html/vergangene-termine.html
                  ./html/impressum.html
                  ./html/datenschutz.html
                ]
            );
        };
    };
}