allow extensions.html to not exist
This commit is contained in:
parent
6338810e28
commit
c3dadd065a
|
@ -212,7 +212,13 @@ namespace TYTD
|
||||||
}
|
}
|
||||||
Dictionary<string, string> templating = new Dictionary<string, string>();
|
Dictionary<string, string> templating = new Dictionary<string, string>();
|
||||||
templating.Add("Items", b.ToString());
|
templating.Add("Items", b.ToString());
|
||||||
Page = Templating.RenderFile(Path.Combine("WebSite", "extensions.html"), templating);
|
string combined= Path.Combine("WebSite", "extensions.html");
|
||||||
|
string template = "<!DOCTYPE html><head><title>Extensions</title></head><body><h1>Extensions</h1><table><thead><tr><th>Name</th><th>Urls</th></tr></thead><tbody>{Items}</tbody></table></body></html>";
|
||||||
|
if (File.Exists(combined))
|
||||||
|
{
|
||||||
|
template = File.ReadAllText(combined);
|
||||||
|
}
|
||||||
|
Page = Templating.RenderString(template, templating);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue