allow extensions.html to not exist

This commit is contained in:
Mike Nolan 2021-12-31 09:36:09 -06:00
parent 6338810e28
commit c3dadd065a
8 changed files with 7 additions and 1 deletions

View File

@ -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.