Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/Pretzel.Logic/Templating/JekyllEngineBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class JekyllEngineBase : ISiteEngine

[Import(AllowDefault = true)]
private ILightweightMarkupEngine _lightweightMarkupEngine;

public abstract void Initialize();

protected abstract void PreProcess();
Expand Down Expand Up @@ -211,22 +211,6 @@ private void ProcessFile(string outputDirectory, Page page, Page previous, Page
continue;
}

try
{
context.FullContent = RenderTemplate(context.FullContent, context);
}
catch (Exception ex)
{
if (!skipFileOnError)
{
var message = string.Format("Failed to process {0}, see inner exception for more details", context.OutputPath);
throw new PageProcessingException(message, ex);
}

Console.WriteLine(@"Failed to process {0}: {1}", context.OutputPath, ex);
continue;
}

CreateOutputDirectory(context.OutputPath);
FileSystem.File.WriteAllText(context.OutputPath, context.FullContent);
}
Expand All @@ -242,7 +226,7 @@ private string RenderContent(string file, string contents)
html = Path.GetExtension(file).IsMarkdownFile()
? _lightweightMarkupEngine.Convert(contentsWithoutHeader).Trim()
: contentsWithoutHeader;

if (ContentTransformers != null)
{
html = ContentTransformers.Aggregate(html, (current, contentTransformer) => contentTransformer.Transform(current));
Expand Down