void ExecuteFilters(StaticFile staticFile, Site site) { foreach (var filterName in staticFile.FilterNameQueue) { IFilter filter = filterFactory.CreateFilter(filterName); string source = staticFile.GetLastSnapShot(); var arguments = new Dictionary <string, object> { { "configuration", site.Configuration as IDictionary <string, object> }, { "item", staticFile.Item.Meta } }; string result = filter.Execute(source, arguments); staticFile.CreateSnapShot(result); } }
void ExecuteLayoutFilter(StaticFile staticFile, Site site) { if (staticFile.Layout != null) { var layoutRule = site.GetLayoutRuleFor(staticFile.Layout); IFilter filter = filterFactory.CreateFilter(layoutRule.FilterName); var arguments = new Dictionary <string, object> { { "configuration", site.Configuration as IDictionary <string, object> }, { "layout", staticFile.Layout.Meta }, { "item", staticFile.Item.Meta }, { "content", staticFile.GetLastSnapShot() } }; string result = filter.Execute(staticFile.Layout.Content, arguments); staticFile.CreateSnapShot(result); } }
void ExecuteFilters(StaticFile staticFile, Site site) { foreach (var filterName in staticFile.FilterNameQueue) { IFilter filter = filterFactory.CreateFilter(filterName); string source = staticFile.GetLastSnapShot(); var arguments = new Dictionary<string, object> { { "configuration", site.Configuration as IDictionary<string, object> }, { "item", staticFile.Item.Meta } }; string result = filter.Execute(source, arguments); staticFile.CreateSnapShot(result); } }
void ExecuteLayoutFilter(StaticFile staticFile, Site site) { if (staticFile.Layout != null) { var layoutRule = site.GetLayoutRuleFor(staticFile.Layout); IFilter filter = filterFactory.CreateFilter(layoutRule.FilterName); var arguments = new Dictionary<string, object> { { "configuration", site.Configuration as IDictionary<string, object> }, { "layout", staticFile.Layout.Meta }, { "item", staticFile.Item.Meta }, { "content", staticFile.GetLastSnapShot() } }; string result = filter.Execute(staticFile.Layout.Content, arguments); staticFile.CreateSnapShot(result); } }