Page createPage(JournalEntry entry) { var filename = entry.Filename; var fileId = ReadableURL.read(filename.ToString()); var pageId = Journal.Id + "/" + fileId; string footer = ""; if (Journal.Comments_ != null) { footer = Journal.Comments_.createScriptForCommentArea("/" + pageId); } return(new Page(pageId, filename.NamePart) { Content = entry.Content + footer }); }
static JournalEntry loadJournalEntry(Journal journal, string filePath) { var filename = JournalEntryFilename.fromFilename(Path.GetFileName(filePath)); var content = readJournalContent(filePath); var entryId = journal.Id + "/" + ReadableURL.read(filename.ToString()); var header = "[](module:BlogEntryHeader?entry={0}&name={1}&date={2})".format( HttpUtility.UrlEncode(entryId), HttpUtility.UrlEncode(filename.NamePart), HttpUtility.UrlEncode(DateReader.printDateTimeCode(filename.DateTimeCode))); var headerHTML = MarkdownReader.fromString(header); var date = DateReader.fromDateTimeCode(filename.DateTimeCode); return(new JournalEntry { Id = entryId, Filename = filename, Content = headerHTML + content, Date = date }); }