fix pages with spaces
This commit is contained in:
parent
3d55fead09
commit
b6a96ef07e
13
pkgs-lib.nix
13
pkgs-lib.nix
@ -82,8 +82,13 @@ in {
|
|||||||
local ? false,
|
local ? false,
|
||||||
config ? {},
|
config ? {},
|
||||||
} @ args: let
|
} @ args: let
|
||||||
|
getPath = from: name:
|
||||||
|
l.path {
|
||||||
|
name = l.strings.sanitizeDerivationName name;
|
||||||
|
path = "${toString from}/${name}";
|
||||||
|
};
|
||||||
postsRendered = let
|
postsRendered = let
|
||||||
path = src + "/posts";
|
path = "${toString src}/posts";
|
||||||
in
|
in
|
||||||
l.pipe (l.readDir path) [
|
l.pipe (l.readDir path) [
|
||||||
(l.mapAttrsToList (
|
(l.mapAttrsToList (
|
||||||
@ -99,7 +104,7 @@ in {
|
|||||||
if date == ""
|
if date == ""
|
||||||
then null
|
then null
|
||||||
else date;
|
else date;
|
||||||
content = l.readFile (parseMarkdown id (path + "/${name}"));
|
content = l.readFile (parseMarkdown id (getPath path name));
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
(l.sort (
|
(l.sort (
|
||||||
@ -117,14 +122,14 @@ in {
|
|||||||
))
|
))
|
||||||
];
|
];
|
||||||
pagesRendered = let
|
pagesRendered = let
|
||||||
path = src + "/pages";
|
path = "${toString src}/pages";
|
||||||
in
|
in
|
||||||
l.mapAttrsToList
|
l.mapAttrsToList
|
||||||
(
|
(
|
||||||
name: _: rec {
|
name: _: rec {
|
||||||
displayName = l.head (l.splitString "." name);
|
displayName = l.head (l.splitString "." name);
|
||||||
id = l.replaceStrings [" "] ["_"] displayName;
|
id = l.replaceStrings [" "] ["_"] displayName;
|
||||||
content = l.readFile (parseMarkdown id (path + "/${name}"));
|
content = l.readFile (parseMarkdown id (getPath path name));
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
(l.readDir path);
|
(l.readDir path);
|
||||||
|
Loading…
Reference in New Issue
Block a user