diff --git a/src/FastBlog.Web/DisplayOptions.cs b/src/FastBlog.Web/DisplayOptions.cs new file mode 100644 index 0000000..9d42c31 --- /dev/null +++ b/src/FastBlog.Web/DisplayOptions.cs @@ -0,0 +1,8 @@ +namespace FastBlog.Web; + +public class DisplayOptions +{ + public string Title { get; init; } = "FastBlog"; + + public Dictionary Links { get; init; } = []; +} \ No newline at end of file diff --git a/src/FastBlog.Web/Program.cs b/src/FastBlog.Web/Program.cs index ca27467..8f9fddd 100644 --- a/src/FastBlog.Web/Program.cs +++ b/src/FastBlog.Web/Program.cs @@ -1,4 +1,5 @@ using FastBlog.Core; +using FastBlog.Web; var builder = WebApplication.CreateBuilder(args); @@ -9,6 +10,7 @@ else builder.Services.AddControllersWithViews(); builder.Services.AddCore(builder.Configuration); +builder.Services.Configure(builder.Configuration.GetSection("Display")); var app = builder.Build(); diff --git a/src/FastBlog.Web/Views/Shared/_Layout.cshtml b/src/FastBlog.Web/Views/Shared/_Layout.cshtml index f3cbd2a..bd5deeb 100644 --- a/src/FastBlog.Web/Views/Shared/_Layout.cshtml +++ b/src/FastBlog.Web/Views/Shared/_Layout.cshtml @@ -1,4 +1,7 @@ -@{ +@using Microsoft.Extensions.Options +@inject IOptions options; + +@{ ViewContext.HttpContext.Response.Headers.Add("Vary", "Hx-Request"); } @@ -13,7 +16,7 @@ return; - @ViewData["Title"] | FastBlog.Web + @ViewData["Title"] | @options.Value.Title @@ -26,13 +29,14 @@ return;