diff --git a/src/Pretzel.Logic/Recipe/Recipe.cs b/src/Pretzel.Logic/Recipe/Recipe.cs index 09e0832d9..1d589aefe 100644 --- a/src/Pretzel.Logic/Recipe/Recipe.cs +++ b/src/Pretzel.Logic/Recipe/Recipe.cs @@ -10,7 +10,7 @@ namespace Pretzel.Logic.Recipe { public class Recipe { - public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerable additionalIngredients, bool withProject, bool wiki) + public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerable additionalIngredients, bool withProject, bool wiki, bool withDrafts = false) { this.fileSystem = fileSystem; this.engine = engine; @@ -18,6 +18,7 @@ public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerab this.additionalIngredients = additionalIngredients; this.withProject = withProject; this.wiki = wiki; + this.withDrafts = withDrafts; } private readonly IFileSystem fileSystem; @@ -26,6 +27,7 @@ public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerab private readonly IEnumerable additionalIngredients; private readonly bool withProject; private readonly bool wiki; + private readonly bool withDrafts; public void Create() { @@ -161,6 +163,9 @@ private void CreateDirectories() fileSystem.Directory.CreateDirectory(Path.Combine(directory, @"_layouts")); fileSystem.Directory.CreateDirectory(Path.Combine(directory, @"css")); fileSystem.Directory.CreateDirectory(Path.Combine(directory, @"img")); + if (withDrafts) { + fileSystem.Directory.CreateDirectory(Path.Combine(directory, @"_drafts")); + } } } } diff --git a/src/Pretzel.Logic/Resources/Liquid/Sitemap.liquid b/src/Pretzel.Logic/Resources/Liquid/Sitemap.liquid index fd615561f..a72fbd61a 100644 --- a/src/Pretzel.Logic/Resources/Liquid/Sitemap.liquid +++ b/src/Pretzel.Logic/Resources/Liquid/Sitemap.liquid @@ -11,7 +11,7 @@ layout: nil {% for post in site.posts %} - http://domain/{{ post.url }} + http://domain/{{ post.url }} {{ post.date | date_to_xmlschema }} daily 1.00 diff --git a/src/Pretzel.Logic/Resources/Razor/Index.cshtml b/src/Pretzel.Logic/Resources/Razor/Index.cshtml index 47c38496d..15e3cca02 100644 --- a/src/Pretzel.Logic/Resources/Razor/Index.cshtml +++ b/src/Pretzel.Logic/Resources/Razor/Index.cshtml @@ -51,7 +51,7 @@ title : SiteName

OLDER

    -@foreach(var post in Model.Site.Posts.Skip(5)) +@foreach(var post in Model.Site.Posts.Skip(numberPosts)) {
  • @post.Date.ToString("d m") @post.Title diff --git a/src/Pretzel.Logic/Resources/Razor/Rss.cshtml b/src/Pretzel.Logic/Resources/Razor/Rss.cshtml index e0902e584..7a264d762 100644 --- a/src/Pretzel.Logic/Resources/Razor/Rss.cshtml +++ b/src/Pretzel.Logic/Resources/Razor/Rss.cshtml @@ -17,10 +17,10 @@ layout: nil { @post.Title - http://domain@post.Url + @Raw("")http://domain@(post.Url)@Raw("") @* Workaround: RazorEngine is a HTML5 template engine, where link is a void element *@ @post.Date.ToString("ddd, dd MMM yyyy H:mm:ss K") Author - http://domain@post.Url + http://domain@(post.Url) @post.Content } diff --git a/src/Pretzel.Logic/Resources/Razor/Sitemap.cshtml b/src/Pretzel.Logic/Resources/Razor/Sitemap.cshtml index 44581308d..530846958 100644 --- a/src/Pretzel.Logic/Resources/Razor/Sitemap.cshtml +++ b/src/Pretzel.Logic/Resources/Razor/Sitemap.cshtml @@ -13,7 +13,7 @@ layout: nil @foreach (var post in Model.Site.Posts) { - http://domain/@post.Url + http://domain/@post.Url @post.Date.ToString("s") daily 1.00 diff --git a/src/Pretzel/Commands/RecipeCommand.cs b/src/Pretzel/Commands/RecipeCommand.cs index aef53ed5b..b6593b705 100644 --- a/src/Pretzel/Commands/RecipeCommand.cs +++ b/src/Pretzel/Commands/RecipeCommand.cs @@ -41,7 +41,7 @@ public void Execute(IEnumerable arguments) Tracing.Info(string.Format("Using {0} Engine", engine)); - var recipe = new Recipe(fileSystem, engine, parameters.Path, additionalIngredients, parameters.WithProject, parameters.Wiki); + var recipe = new Recipe(fileSystem, engine, parameters.Path, additionalIngredients, parameters.WithProject, parameters.Wiki, parameters.IncludeDrafts); recipe.Create(); }