Exemplo n.º 1
0
        private Dictionary <string, string> ProcessFrontMatter(RawFragment fragment)
        {
            if (string.IsNullOrWhiteSpace(fragment.FrontMatter))
            {
                _logger.LogTrace("Fragment has no front matter to process");
                return(new Dictionary <string, string>());
            }

            var frontMatter = _yamlDeserializer.Deserialize <Dictionary <string, string> >(fragment.FrontMatter);

            return(frontMatter);
        }
Exemplo n.º 2
0
        private string ProcessMarkdown(RawFragment fragment)
        {
            if (string.IsNullOrWhiteSpace(fragment.PageMarkdown))
            {
                _logger.LogTrace("Fragment has no markdown to process");
                return(string.Empty);
            }

            var html = Markdown.ToHtml(fragment.PageMarkdown, _markdownPipeline);

            return(html);
        }