Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion src/Pretzel.Logic/Recipe/Recipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ namespace Pretzel.Logic.Recipe
{
public class Recipe
{
public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerable<IAdditionalIngredient> additionalIngredients, bool withProject, bool wiki)
public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerable<IAdditionalIngredient> additionalIngredients, bool withProject, bool wiki, bool withDrafts = false)
{
this.fileSystem = fileSystem;
this.engine = engine;
this.directory = directory;
this.additionalIngredients = additionalIngredients;
this.withProject = withProject;
this.wiki = wiki;
this.withDrafts = withDrafts;
}

private readonly IFileSystem fileSystem;
Expand All @@ -26,6 +27,7 @@ public Recipe(IFileSystem fileSystem, string engine, string directory, IEnumerab
private readonly IEnumerable<IAdditionalIngredient> additionalIngredients;
private readonly bool withProject;
private readonly bool wiki;
private readonly bool withDrafts;

public void Create()
{
Expand Down Expand Up @@ -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"));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Pretzel.Logic/Resources/Liquid/Sitemap.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ layout: nil

{% for post in site.posts %}
<url>
<loc>http://domain/{{ post.url }}</id>
<loc>http://domain/{{ post.url }}</loc>
<lastmod>{{ post.date | date_to_xmlschema }}</lastmod>
<changefreq>daily</changefreq>
<priority>1.00</priority>
Expand Down
2 changes: 1 addition & 1 deletion src/Pretzel.Logic/Resources/Razor/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ title : SiteName

<h3>OLDER</h3>
<ul class="postArchive">
@foreach(var post in Model.Site.Posts.Skip(5))
@foreach(var post in Model.Site.Posts.Skip(numberPosts))
{
<li>
<span class="olderpostdate">@post.Date.ToString("d m")</span> <a class="postlink" href="@post.Url">@post.Title</a>
Expand Down
4 changes: 2 additions & 2 deletions src/Pretzel.Logic/Resources/Razor/Rss.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ layout: nil
{
<item>
<title>@post.Title</title>
<link>http://domain@post.Url</link>
@Raw("<link>")http://domain@(post.Url)@Raw("</link>") @* Workaround: RazorEngine is a HTML5 template engine, where link is a void element *@
<pubDate>@post.Date.ToString("ddd, dd MMM yyyy H:mm:ss K")</pubDate>
<author>Author</author>
<guid>http://domain@post.Url</guid>
<guid>http://domain@(post.Url)</guid>
<description>@post.Content</description>
</item>
}
Expand Down
2 changes: 1 addition & 1 deletion src/Pretzel.Logic/Resources/Razor/Sitemap.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ layout: nil
@foreach (var post in Model.Site.Posts)
{
<url>
<loc>http://domain/@post.Url</id>
<loc>http://domain/@post.Url</loc>
<lastmod>@post.Date.ToString("s")</lastmod>
<changefreq>daily</changefreq>
<priority>1.00</priority>
Expand Down
2 changes: 1 addition & 1 deletion src/Pretzel/Commands/RecipeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void Execute(IEnumerable<string> 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();
}

Expand Down