diff --git a/default.nix b/default.nix
index 2715090..eaa1fb8 100644
--- a/default.nix
+++ b/default.nix
@@ -7,16 +7,26 @@
];
website = {
- url = "https://localhost/";
+ url = "https://webzine.snowflake.ovh/";
style = builtins.readFile ./style.html;
+ header = ''
+
+ '';
};
in
pkgs.stdenv.mkDerivation rec {
name = "nixos-webzine";
+ src = ./static;
+
builder = pkgs.writeShellScript "builder.sh" (
''
- ${pkgs.busybox}/bin/mkdir -p $out
+ ${pkgs.busybox}/bin/mkdir -p $out/static
+ ${pkgs.busybox}/bin/cp ${index_generator}/* $out/
+ ${pkgs.busybox}/bin/cp -fr $src/* $out/static/
''
+ (
pkgs.lib.concatStringsSep "\n"
@@ -30,7 +40,7 @@ in
pages_generator = (builtins.map (element: let
issue = import element;
in
- pkgs.writeTextDir "${issue.number}.html" ''
+ pkgs.writeTextDir "issue-${issue.number}.html" ''
@@ -50,13 +60,15 @@ in
${website.style}
+ ${website.header}
-
- ${
+
+
+ ${
if (builtins.length issue.news) != 0
then ''
- ❄ ❄ ❄
+ ❄ ❄ ❄
News
${pkgs.lib.concatStringsSep "\n" (builtins.map (item: ''
@@ -69,12 +81,12 @@ in
else ""
}
-
- ${
+
+ ${
if issue.tips != ""
then ''
- ❄ ❄ ❄
+ ❄ ❄ ❄
Tips
${issue.tips}
@@ -82,16 +94,16 @@ in
else ""
}
-
- ${
+
+ ${
if (builtins.length issue.links) != 0
then ''
- ❄ ❄ ❄
+ ❄ ❄ ❄
Going further
${pkgs.lib.concatStringsSep "\n" (builtins.map (item: ''
- - ${item}
+ - ${item.text} [link]
'')
issue.links)}
@@ -99,6 +111,40 @@ in
''
else ""
}
+
+
+ ${
+ if issue.artwork.url != ""
+ then ''
+
+ ❄ ❄ ❄
+ Artwork of the moment
+
+
+ ''
+ else ""
+ }
+
+
+ ${
+ if issue.editors != ""
+ then ''
+
+ ❄ ❄ ❄
+ Notes from the editorial team
+ ${issue.editors}
+
+ ''
+ else ""
+ }