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
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user