Skip to content

Commit

Permalink
Lowercase path names and slugs, closes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-c committed Apr 17, 2020
1 parent 5704160 commit d10f379
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/item.d
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import std.uni : toLower;
import std.file : readText;
import std.path : baseName, stripExtension;
import std.json;
Expand All @@ -22,7 +23,7 @@ Item parseItem(const string itemPath)
JSONValue j = content[0 .. indexOf(content, '\n')].parseJSON;

Item i;
i.path = itemPath;
i.path = itemPath.toLower;
i.title = j["title"].str;
i.slug = itemPath.stripExtension.baseName;
i.date = Date.fromISOExtString(j["date"].str);
Expand Down

0 comments on commit d10f379

Please sign in to comment.