From 3080bc41e65d1402305ceab2ac4f6ab57ee23ffa Mon Sep 17 00:00:00 2001 From: Mark Groves Date: Sun, 16 Dec 2012 15:52:56 -0800 Subject: [PATCH] Fixed test failures and use of -d paths fixed a problem where the blogger import tests fail if not on the other side of the date line. fixed directory pathing if you pass in the -d parameter. It was creating duplicate levels on bake within -d --- src/Pretzel.Logic/Commands/CommandParameters.cs | 4 ++++ src/Pretzel.Logic/Import/BloggerImport.cs | 2 +- src/Pretzel.Logic/Templating/Context/SiteContextGenerator.cs | 3 --- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Pretzel.Logic/Commands/CommandParameters.cs b/src/Pretzel.Logic/Commands/CommandParameters.cs index 31cf68239..a53585d0b 100644 --- a/src/Pretzel.Logic/Commands/CommandParameters.cs +++ b/src/Pretzel.Logic/Commands/CommandParameters.cs @@ -82,6 +82,10 @@ public void Parse(IEnumerable arguments) { Path = Directory.GetCurrentDirectory(); } + else + { + Path = System.IO.Path.GetFullPath(Path); + } } public void DetectFromDirectory(IDictionary engines, SiteContext context) diff --git a/src/Pretzel.Logic/Import/BloggerImport.cs b/src/Pretzel.Logic/Import/BloggerImport.cs index 14811dc3e..8a08a501a 100644 --- a/src/Pretzel.Logic/Import/BloggerImport.cs +++ b/src/Pretzel.Logic/Import/BloggerImport.cs @@ -54,7 +54,7 @@ where e.Elements(atom + "category").Where(x => x.Attribute("term").Value == "htt { Title = e.Element(atom + "title").Value, //PostName = e.Element(wp + "post_name").Value, - Published = Convert.ToDateTime(e.Element(atom + "published").Value), + Published = Convert.ToDateTime(e.Element(atom + "published").Value).ToUniversalTime(), Updated = Convert.ToDateTime(e.Element(atom + "updated").Value), Content = ConvertToMarkdown(e.Element(atom + "content").Value), /*Tags = from t in e.Elements(atom + "category") diff --git a/src/Pretzel.Logic/Templating/Context/SiteContextGenerator.cs b/src/Pretzel.Logic/Templating/Context/SiteContextGenerator.cs index df8603006..7d78a870a 100644 --- a/src/Pretzel.Logic/Templating/Context/SiteContextGenerator.cs +++ b/src/Pretzel.Logic/Templating/Context/SiteContextGenerator.cs @@ -187,10 +187,7 @@ private Page CreatePage(SiteContext context, IDictionary config, if (header.ContainsKey("permalink")) page.Url = EvaluatePermalink(header["permalink"].ToString(), page); else if (config.ContainsKey("permalink")) - { page.Url = EvaluatePermalink(config["permalink"].ToString(), page); - page.Bag.Add("permalink", config["permalink"].ToString()); - } // The GetDirectoryPage method is reentrant, we need a cache to stop a stack overflow :) pageCache.Add(file, page);