public void Execute(string[] arguments) { Settings.Parse(arguments); var fileSystem = new FileSystem(); if (string.IsNullOrWhiteSpace(Path)) { Path = Directory.GetCurrentDirectory(); } if (string.IsNullOrWhiteSpace(Engine)) { Engine = InferEngineFromDirectory(Path, fileSystem); } ISiteEngine engine; if (engineMap.TryGetValue(Engine, out engine)) { var context = new SiteContext { Folder = Path }; engine.Initialize(fileSystem, context); engine.Process(); } else { System.Diagnostics.Debug.WriteLine("Cannot find engine for input: '{0}'", Engine); } }
public void Execute(string[] arguments) { Tracing.Info("bake - transforming content into a website"); Settings.Parse(arguments); if (string.IsNullOrWhiteSpace(Path)) { Path = Directory.GetCurrentDirectory(); } if (string.IsNullOrWhiteSpace(Engine)) { Engine = InferEngineFromDirectory(Path); } ISiteEngine engine; if (engineMap.TryGetValue(Engine, out engine)) { var context = new SiteContext { Folder = Path }; engine.Initialize(); engine.Process(context); } else { Console.WriteLine("Cannot find engine for input: '{0}'", Engine); System.Diagnostics.Debug.WriteLine("Cannot find engine for input: '{0}'", Engine); } }
private static Hash CreatePageData(SiteContext context) { return Hash.FromAnonymousObject(new { page = new { title = context.Title } }); }
private static Hash CreatePageData(SiteContext context, PageContext pageContext) { var title = string.IsNullOrWhiteSpace(pageContext.Title) ? context.Title : pageContext.Title; return Hash.FromAnonymousObject(new { page = new { title }, content = pageContext.Content }); }
public void Initialize(IFileSystem fileSystem, SiteContext context) { this.fileSystem = fileSystem; this.context = context; }