protected override void ProcessRecord() { if (ParameterSetName == "FromPath") { if (helper == null) { helper = Site.ForPath(GetPluginPath(Path)); } ProviderInfo providerInfo; var files = GetResolvedProviderPathFromPSPath(Path, out providerInfo); foreach (var file in files) { Markup = new NamedContentBase(file, preloadContent: true); WriteObject(helper[Markup.Extension].Render(SiteRootPath, Markup.RawContent, Data)); } } else { if (helper == null) { helper = Site.ForPath(GetPluginPath(Markup.SourcePath)); } Markup.RenderedContent = helper[Markup.Extension].Render(SiteRootPath, Markup.RawContent, Data); WriteObject(Markup); } }
protected void Render(NamedContentBase layout, dynamic model, string outputPath) { Utility.CreateDirectoryIfNecessary(Path.GetDirectoryName(outputPath)); File.WriteAllText(outputPath, Render(layout, model)); }
public string Render(NamedContentBase layout, dynamic model) { return(_renderEngines[layout.Extension].Render(SiteRootPath, layout.RawContent, model)); }
public void Render(NamedContentBase doc) { doc.RenderedContent = Render(doc, doc); }