handle pages and posts not existing

This commit is contained in:
dusk 2023-04-06 06:58:20 +03:00
parent c6bd196fdc
commit 4ffd5d4fa5
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA

View File

@ -94,6 +94,8 @@ in {
postsRendered = let
path = "${toString src}/posts";
in
if l.pathExists postsRendered
then
l.pipe (l.readDir path) [
(l.mapAttrsToList (
name: _: let
@ -124,10 +126,13 @@ in {
then true
else !(d 0 > od 0 && d 1 > od 1 && d 2 > od 2)
))
];
]
else [];
pagesRendered = let
path = "${toString src}/pages";
in
if l.pathExists path
then
l.mapAttrsToList
(
name: _: rec {
@ -136,7 +141,8 @@ in {
content = l.readFile (parseMarkdown id (getPath path name));
}
)
(l.readDir path);
(l.readDir path)
else [];
baseurl =
if local
then "http://localhost:8080"