From c7a13f04c9375d5b6ed45c95649044f8653b8d65 Mon Sep 17 00:00:00 2001 From: valentin gagarin Date: Wed, 13 Nov 2024 15:24:41 +0100 Subject: [PATCH] don't use outPath any more - links are constructed explicitly, relative to the current page's location - templates are called explicitly by output type --- website/presentation/default.nix | 2 +- website/structure/document.nix | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/website/presentation/default.nix b/website/presentation/default.nix index 0d3eb285..38ca658a 100644 --- a/website/presentation/default.nix +++ b/website/presentation/default.nix @@ -42,7 +42,7 @@ in head = '' ${page.title} - + ''; body = '' ${config.menus.main.outputs.html page} diff --git a/website/structure/document.nix b/website/structure/document.nix index 632a6511..eca89c88 100644 --- a/website/structure/document.nix +++ b/website/structure/document.nix @@ -14,9 +14,6 @@ in type = types.str; default = name; }; - # TODO: reconsider using `page.outPath` and what to put into `locations`. - # maybe we can avoid having ".html" suffixes there. - # since templates can output multiple files, `html` is merely one of many things we *could* produce. locations = mkOption { description = '' List of historic output locations for the resulting file @@ -46,15 +43,7 @@ in # TODO: we may want links to other representations, # and currently the mapping of output types to output file # names is soft. - default = target: with lib; "${relativePath config.outPath target.outPath}.html"; - }; - # TODO: may not need it when using `link`; could repurpose it to render the default template - outPath = mkOption { - description = '' - Location of the page, used for transparently creating links - ''; - type = types.str; - default = lib.head config.locations; + default = target: with lib; "${relativePath (head config.locations) (head target.locations)}.html"; }; outputs = mkOption { description = ''