Skip to content

Commit

Permalink
Update Configure.Markdown.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Mar 23, 2024
1 parent ce01b8a commit d0b9ddf
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions MyApp/Configure.Markdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,40 @@ namespace MyApp;
public class ConfigureMarkdown : IHostingStartup
{
public void Configure(IWebHostBuilder builder) => builder
.ConfigureServices(services =>
{
.ConfigureServices(services => {
services.AddSingleton<MarkdownIncludes>();
services.AddSingleton<MarkdownPages>();
services.AddSingleton<MarkdownVideos>();
services.AddSingleton<MarkdownBlog>();
services.AddSingleton<MarkdownMeta>();
})
.ConfigureAppHost(
appHost => appHost.Plugins.Add(new CleanUrlsFeature()),
afterPluginsLoaded: appHost =>
.ConfigureAppHost(afterPluginsLoaded: appHost => {
MarkdigConfig.Set(new MarkdigConfig
{
MarkdigConfig.Set(new MarkdigConfig
ConfigurePipeline = pipeline =>
{
ConfigurePipeline = pipeline =>
{
// Extend Markdig Pipeline
},
ConfigureContainers = config =>
{
config.AddBuiltInContainers();
// Add Custom Block or Inline containers
}
});
// Extend Markdig Pipeline
},
ConfigureContainers = config =>
{
config.AddBuiltInContainers();
// Add Custom Block or Inline containers
}
});
var includes = appHost.Resolve<MarkdownIncludes>();
var pages = appHost.Resolve<MarkdownPages>();
var videos = appHost.Resolve<MarkdownVideos>();
var blogPosts = appHost.Resolve<MarkdownBlog>();
var meta = appHost.Resolve<MarkdownMeta>();
var includes = appHost.Resolve<MarkdownIncludes>();
var pages = appHost.Resolve<MarkdownPages>();
var videos = appHost.Resolve<MarkdownVideos>();
var blogPosts = appHost.Resolve<MarkdownBlog>();
var meta = appHost.Resolve<MarkdownMeta>();
meta.Features = [pages, videos, blogPosts];
includes.LoadFrom("_includes");
pages.LoadFrom("_pages");
videos.LoadFrom("_videos");
blogPosts.LoadFrom("_posts");
});
meta.Features = [pages, videos, blogPosts];
includes.LoadFrom("_includes");
pages.LoadFrom("_pages");
videos.LoadFrom("_videos");
blogPosts.LoadFrom("_posts");
});
}

// Add additional frontmatter info to include
Expand Down

0 comments on commit d0b9ddf

Please sign in to comment.