handle pages and posts not existing
This commit is contained in:
parent
c6bd196fdc
commit
4ffd5d4fa5
10
pkgs-lib.nix
10
pkgs-lib.nix
@ -94,6 +94,8 @@ in {
|
|||||||
postsRendered = let
|
postsRendered = let
|
||||||
path = "${toString src}/posts";
|
path = "${toString src}/posts";
|
||||||
in
|
in
|
||||||
|
if l.pathExists postsRendered
|
||||||
|
then
|
||||||
l.pipe (l.readDir path) [
|
l.pipe (l.readDir path) [
|
||||||
(l.mapAttrsToList (
|
(l.mapAttrsToList (
|
||||||
name: _: let
|
name: _: let
|
||||||
@ -124,10 +126,13 @@ in {
|
|||||||
then true
|
then true
|
||||||
else !(d 0 > od 0 && d 1 > od 1 && d 2 > od 2)
|
else !(d 0 > od 0 && d 1 > od 1 && d 2 > od 2)
|
||||||
))
|
))
|
||||||
];
|
]
|
||||||
|
else [];
|
||||||
pagesRendered = let
|
pagesRendered = let
|
||||||
path = "${toString src}/pages";
|
path = "${toString src}/pages";
|
||||||
in
|
in
|
||||||
|
if l.pathExists path
|
||||||
|
then
|
||||||
l.mapAttrsToList
|
l.mapAttrsToList
|
||||||
(
|
(
|
||||||
name: _: rec {
|
name: _: rec {
|
||||||
@ -136,7 +141,8 @@ in {
|
|||||||
content = l.readFile (parseMarkdown id (getPath path name));
|
content = l.readFile (parseMarkdown id (getPath path name));
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(l.readDir path);
|
(l.readDir path)
|
||||||
|
else [];
|
||||||
baseurl =
|
baseurl =
|
||||||
if local
|
if local
|
||||||
then "http://localhost:8080"
|
then "http://localhost:8080"
|
||||||
|
Loading…
Reference in New Issue
Block a user