コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
ファイル: Compiler.cs プロジェクト: wilsonmar/mulder
		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);
			}
		}
コード例 #4
0
ファイル: Compiler.cs プロジェクト: wilsonmar/mulder
		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);
			}
		}