update example to work with latest changes
This commit is contained in:
parent
9fc59b7048
commit
f6bc03bea7
7 changed files with 10 additions and 11 deletions
|
@ -8,7 +8,10 @@
|
|||
inherit (lib.lists) map;
|
||||
inherit (lib.strings) replaceStrings toLower;
|
||||
|
||||
_nte = nte {inherit extraArgs entries templates;};
|
||||
|
||||
extraArgs = {
|
||||
inherit (_nte) getEntry;
|
||||
h = n: content: let
|
||||
id = replaceStrings [" " ";"] ["-" "-"] (toLower content);
|
||||
in /*html*/''
|
||||
|
@ -40,7 +43,7 @@ in
|
|||
buildPhase = /*sh*/''
|
||||
runHook preBuild
|
||||
|
||||
${nte {inherit extraArgs entries templates;}}
|
||||
${_nte.buildScript}
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
_: {
|
||||
template = "base";
|
||||
file = "index.html";
|
||||
|
||||
head = /*html*/''
|
||||
<title>nte example</title>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
getEntry,
|
||||
pkgs,
|
||||
...
|
||||
} @ entryArgs: let
|
||||
}: let
|
||||
inherit (pkgs) lib;
|
||||
inherit (lib.lists) map;
|
||||
inherit (lib.strings) concatStrings;
|
||||
in {
|
||||
template = "base";
|
||||
file = "posts/index.html";
|
||||
|
||||
head = /*html*/''
|
||||
<title>nte posts</title>
|
||||
|
@ -25,7 +25,7 @@ in {
|
|||
'';
|
||||
in /*html*/''
|
||||
<div id="posts">
|
||||
${concatStrings (map (postFile: postItem ((import postFile) entryArgs))
|
||||
${concatStrings (map (postFile: postItem (getEntry postFile))
|
||||
[
|
||||
./test.nix
|
||||
]
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
...
|
||||
}: {
|
||||
template = "post";
|
||||
file = "posts/test.html";
|
||||
|
||||
title = "Test post (using nte)";
|
||||
author = "jacekpoz";
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
...
|
||||
}: {
|
||||
name = "base";
|
||||
format = "html";
|
||||
|
||||
output = /*html*/''
|
||||
<html>
|
||||
|
|
|
@ -4,14 +4,11 @@
|
|||
created,
|
||||
content,
|
||||
...
|
||||
} @ extraArgs : let
|
||||
inherit (extraArgs) file;
|
||||
in {
|
||||
}: {
|
||||
name = "post";
|
||||
|
||||
output = {
|
||||
template = "base";
|
||||
inherit file;
|
||||
|
||||
head = /*html*/''
|
||||
<title>${title}</title>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
system: let
|
||||
pkgs = pkgsForEach.${system};
|
||||
in {
|
||||
default = import ./engine.nix pkgs;
|
||||
default = import ./engine.nix pkgs ./example;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue