Skip to content

Commit

Permalink
Add missing properties to itemContext
Browse files Browse the repository at this point in the history
  • Loading branch information
fs-c committed Apr 30, 2020
1 parent 58a6e89 commit eb2bbf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void main(string[] args)
Item[] items;

foreach(string e; dirEntries(contentPath, SpanMode.shallow)) {
auto itemContext = new Mustache.Context;
auto itemContext = new Mustache.Context;
Item i = items[++items.length - 1] = parseItem(e);

if (i.draft)
Expand All @@ -49,8 +49,10 @@ void main(string[] args)
immutable itemPath = buildPath(itemFolder, "index.html");
mkdir(itemFolder);

itemContext["slug"] = i.slug;
itemContext["title"] = i.title;
itemContext["content"] = i.content;
itemContext["date"] = i.date.toISOExtString;

if (i.hidden)
itemContext.useSection("hidden");
Expand Down

0 comments on commit eb2bbf6

Please sign in to comment.