This commit is contained in:
parent
9e8d00d78f
commit
bc6bebea06
4 changed files with 55 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ using Yavsc.Models;
|
|||
using Yavsc.Services;
|
||||
using Yavsc.Server.Helpers;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Options;
|
||||
namespace Yavsc.Blogs;
|
||||
|
||||
internal class Program
|
||||
|
|
@ -22,6 +23,8 @@ internal class Program
|
|||
|
||||
var services = builder.Services;
|
||||
|
||||
var siteSection = builder.Configuration.GetSection("Site");
|
||||
services.Configure<SiteSettings>(siteSection);
|
||||
// MvcBuilder
|
||||
builder.Services
|
||||
.AddAuthorization(options =>
|
||||
|
|
@ -79,8 +82,17 @@ internal class Program
|
|||
options.SetDefaultCulture(supportedCultures[0])
|
||||
.AddSupportedCultures(supportedCultures)
|
||||
.AddSupportedUICultures(supportedCultures);
|
||||
})
|
||||
.Configure<SiteSettings>(settings =>
|
||||
{
|
||||
if (settings.Blog == null)
|
||||
{
|
||||
settings.Blog = "blog";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
// App startup
|
||||
using (var app = builder.Build())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue