refact: Fully refactor the conceptional structure and functional behaviour.

This commit is contained in:
2024-06-21 22:59:30 +08:00
parent 257f5d94ee
commit 2efe2fd5cd
64 changed files with 307 additions and 574 deletions

View File

@@ -0,0 +1,30 @@
using Markdig;
using Microsoft.Extensions.DependencyInjection;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
namespace YaeBlog.Core.Extensions;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddMarkdig(this IServiceCollection collection)
{
MarkdownPipelineBuilder builder = new();
collection.AddSingleton<MarkdownPipeline>(_ => builder.Build());
return collection;
}
public static IServiceCollection AddYamlParser(this IServiceCollection collection)
{
DeserializerBuilder builder = new();
builder.WithNamingConvention(CamelCaseNamingConvention.Instance);
builder.IgnoreUnmatchedProperties();
collection.AddSingleton<IDeserializer>(_ => builder.Build());
return collection;
}
}