protected override void PreProcess() { contextDrop = new SiteContextDrop(Context); Template.FileSystem = new Includes(Context.SourceFolder, FileSystem); if (Filters != null) { foreach (var filter in Filters) { Template.RegisterFilter(filter.GetType()); } } if (Tags != null) { var registerTagMethod = typeof(Template).GetMethod("RegisterTag", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); foreach (var tag in Tags) { var registerTagGenericMethod = registerTagMethod.MakeGenericMethod(new[] { tag.GetType() }); registerTagGenericMethod.Invoke(null, new[] { tag.Name.ToUnderscoreCase() }); } } if(TagFactories!=null) { foreach (var tagFactory in TagFactories) { tagFactory.Initialize(Context); Template.RegisterTagFactory(tagFactory); } } }
protected override void PreProcess() { contextDrop = new SiteContextDrop(Context); if (Filters != null) { foreach (var filter in Filters) { Template.RegisterFilter(filter.GetType()); } } }
#pragma warning restore 0649 public void Process(SiteContext siteContext) { context = siteContext; contextDrop = new SiteContextDrop(context); var outputDirectory = Path.Combine(context.SourceFolder, "_site"); foreach (var p in siteContext.Posts) { ProcessFile(outputDirectory, p, p.Filepath); } foreach (var p in siteContext.Pages) { ProcessFile(outputDirectory, p); } }
protected override void PreProcess() { contextDrop = new SiteContextDrop(Context); }
private static Hash CreatePageData(SiteContext context) { var drop = new SiteContextDrop(context); return Hash.FromAnonymousObject(new { site = drop, page = new { title = context.Title } }); }
private static Hash CreatePageData(SiteContext context, PageContext pageContext) { var title = string.IsNullOrWhiteSpace(pageContext.Title) ? context.Title : pageContext.Title; var drop = new SiteContextDrop(context); return Hash.FromAnonymousObject(new { site = drop, page = new { title }, content = pageContext.Content }); }