-
Notifications
You must be signed in to change notification settings - Fork 4
/
Program.cs
36 lines (34 loc) · 1.49 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Kentico.Kontent.Delivery.Abstractions;
using Kentico.Kontent.Delivery.Extensions;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Statiq.App;
using Statiq.Common;
using Microsoft.Extensions.Configuration;
using Statiq.Web;
using Kentico.Kontent.Statiq.Memoirs.Models;
using MemoirsTheme.Resolvers;
namespace MemoirsTheme
{
public static class Program
{
public static async Task<int> Main(string[] args) =>
await Bootstrapper
.Factory
.CreateDefault(args)
.ConfigureServices((services, settings) =>
{
// pull in site settings from configuration
var siteSettings = (settings as IConfiguration).GetSection("Site").Get<SiteSettings>();
services.AddSingleton(siteSettings);
services.AddSingleton<ITypeProvider, CustomTypeProvider>();
services.AddDeliveryInlineContentItemsResolver(new CodeSnippetResolver());
services.AddDeliveryInlineContentItemsResolver(new GitHubGistResolver());
services.AddDeliveryInlineContentItemsResolver(new SpoilerResolver());
services.AddDeliveryInlineContentItemsResolver(new QuoteResolver());
services.AddDeliveryClient((IConfiguration)settings);
})
.AddHostingCommands()
.RunAsync();
}
}