removed hardcoded texts
This commit is contained in:
parent
c40beff1e3
commit
8c2dccde3e
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace FastBlog.Web;
|
||||||
|
|
||||||
|
public class DisplayOptions
|
||||||
|
{
|
||||||
|
public string Title { get; init; } = "FastBlog";
|
||||||
|
|
||||||
|
public Dictionary<string, string> Links { get; init; } = [];
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using FastBlog.Core;
|
using FastBlog.Core;
|
||||||
|
using FastBlog.Web;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
|
@ -9,6 +10,7 @@ else
|
||||||
builder.Services.AddControllersWithViews();
|
builder.Services.AddControllersWithViews();
|
||||||
|
|
||||||
builder.Services.AddCore(builder.Configuration);
|
builder.Services.AddCore(builder.Configuration);
|
||||||
|
builder.Services.Configure<DisplayOptions>(builder.Configuration.GetSection("Display"));
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
@{
|
@using Microsoft.Extensions.Options
|
||||||
|
@inject IOptions<DisplayOptions> options;
|
||||||
|
|
||||||
|
@{
|
||||||
ViewContext.HttpContext.Response.Headers.Add("Vary", "Hx-Request");
|
ViewContext.HttpContext.Response.Headers.Add("Vary", "Hx-Request");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -13,7 +16,7 @@ return;
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>@ViewData["Title"] | FastBlog.Web</title>
|
<title>@ViewData["Title"] | @options.Value.Title</title>
|
||||||
<link rel="stylesheet" href="~/css/pico.min.css" asp-append-version="true"/>
|
<link rel="stylesheet" href="~/css/pico.min.css" asp-append-version="true"/>
|
||||||
<link rel="stylesheet" href="~/css/pico.colors.min.css" asp-append-version="true"/>
|
<link rel="stylesheet" href="~/css/pico.colors.min.css" asp-append-version="true"/>
|
||||||
<link rel="stylesheet" href="~/FastBlog.Web.styles.css" asp-append-version="true"/>
|
<link rel="stylesheet" href="~/FastBlog.Web.styles.css" asp-append-version="true"/>
|
||||||
|
|
@ -26,13 +29,14 @@ return;
|
||||||
<div>
|
<div>
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="~/"><h1>the1mason</h1></a></li>
|
<li><a href="~/"><h1>@options.Value.Title</h1></a></li>
|
||||||
<li><a href="~/blog/list">Blog</a></li>
|
<li><a href="~/blog/list">Blog</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/the1mason">GitHub</a></li>
|
@foreach (var link in options.Value.Links)
|
||||||
<li><a href="mailto://mail@the1mason.com">Mail</a></li>
|
{
|
||||||
<li><a href="https://linkedin.com/in/the1mason">LinkedIn</a></li>
|
<li><a href="@link.Value">@link.Key</a></li>
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue