diff --git a/OurUmbraco.Site/Views/Lesson.cshtml b/OurUmbraco.Site/Views/Lesson.cshtml index 1de8ce25..50fc2de5 100644 --- a/OurUmbraco.Site/Views/Lesson.cshtml +++ b/OurUmbraco.Site/Views/Lesson.cshtml @@ -3,10 +3,10 @@ @{ Layout = null; - var path = HttpContext.Current.Items[MarkdownLogic.MarkdownPathKey].ToString(); + var path = HttpContext.Current.Items[MarkdownLogic.MarkdownPathKey].ToString(); var ml = new MarkdownLogic(path) { PrefixLinks = false, AppendAltLessonLink = true }; - var markdown = ml.DoTransformation(); + var markdown = ml.DoTransformation(); } @@ -14,33 +14,34 @@ - @@ -50,5 +51,4 @@ @Html.Raw(markdown) - - + \ No newline at end of file diff --git a/OurUmbraco/Documentation/Busineslogic/GithubSourcePull/ZipDownloader.cs b/OurUmbraco/Documentation/Busineslogic/GithubSourcePull/ZipDownloader.cs index f881ac9a..59de1e07 100644 --- a/OurUmbraco/Documentation/Busineslogic/GithubSourcePull/ZipDownloader.cs +++ b/OurUmbraco/Documentation/Busineslogic/GithubSourcePull/ZipDownloader.cs @@ -125,7 +125,7 @@ namespace OurUmbraco.Documentation.Busineslogic.GithubSourcePull RemoveExistingDocumentation(RootFolder); ZipFile.ExtractToDirectory(zip, RootFolder); - var unzippedPath = RootFolder + "\\UmbracoDocs-master\\"; + var unzippedPath = RootFolder + "\\UmbracoDocs-StarterkitLessons\\"; foreach (var directory in new DirectoryInfo(unzippedPath).GetDirectories()) Directory.Move(directory.FullName, RootFolder + "\\" + directory.Name); foreach (var file in new DirectoryInfo(unzippedPath).GetFiles()) @@ -156,7 +156,10 @@ namespace OurUmbraco.Documentation.Busineslogic.GithubSourcePull public int sort { get; set; } public bool hasChildren { get; set; } public List directories { get; set; } - public string url => $"https://our.umbraco.org/documentation{this.path}/?altTemplate=Lesson"; + + public string url => $"http://localhost:24292/documentation{this.path}/?altTemplate=Lesson"; + + //public string url => $"https://our.umbraco.org/documentation{this.path}/?altTemplate=Lesson"; } private SiteMapItem GetFolderStructure(DirectoryInfo dir, string rootPath, int level) diff --git a/OurUmbraco/Documentation/Controllers/LessonsController.cs b/OurUmbraco/Documentation/Controllers/LessonsController.cs index fb802499..c5a3ef2d 100644 --- a/OurUmbraco/Documentation/Controllers/LessonsController.cs +++ b/OurUmbraco/Documentation/Controllers/LessonsController.cs @@ -10,6 +10,7 @@ using Umbraco.Web.Mvc; using Umbraco.Web.WebApi; using System.Web; using OurUmbraco.Documentation.Busineslogic; +using System.Runtime.Serialization; namespace OurUmbraco.Documentation.Controllers { @@ -63,13 +64,13 @@ namespace OurUmbraco.Documentation.Controllers return currentDirectory.directories.OrderBy(x=> x.sort).ToList(); } - public List GetStepsForPath(string path) + public List GetStepsForPath(string path) { var docs = new ZipDownloader(); var rootFolder = global::Umbraco.Core.IO.IOHelper.MapPath("/Documentation/" + path); var mdFiles = System.IO.Directory.GetFiles(rootFolder, "*.md"); - var result = new List(); + var result = new List(); foreach(var fpath in mdFiles) { var content = System.IO.File.ReadAllText(fpath); @@ -77,11 +78,21 @@ namespace OurUmbraco.Documentation.Controllers var md = new MarkdownLogic(fpath); var html = md.DoTransformation(); - result.Add(html); + result.Add(new LessonStep() { Name = name, Content = html }); } return result; } } + + [DataContract(Name = "lessonStep")] + public class LessonStep + { + [DataMember(Name = "name")] + public string Name { get; set; } + + [DataMember(Name = "content")] + public string Content { get; set; } + } }