@using Microsoft.Extensions.Options
@inject IOptions<DisplayOptions> options;

@{
ViewContext.HttpContext.Response.Headers.Add("Vary", "Hx-Request");
}

@if (ViewContext.HttpContext.Request.Headers["Hx-Request"].Contains("true"))
{
@RenderBody()
return;
}

<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <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.colors.min.css" asp-append-version="true"/>
    <link rel="stylesheet" href="~/FastBlog.Web.styles.css" asp-append-version="true"/>
    <link rel="stylesheet" href="~/lib/highlight-js/styles/github-dark.min.css" asp-append-version="true"/>
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true"/>
</head>
<body>
<script src="~/js/htmx.min.js"></script>
<header class="nav-container">
    <div>
        <nav>
            <ul>
                <li><a href="~/"><h1>@options.Value.Title</h1></a></li>
                <li><a href="~/blog/list">Blog</a></li>
                <li><a href="~/edit">New</a></li>
            </ul>
            <ul>
                @foreach (var link in options.Value.Links)
                {
                    <li><a href="@link.Value">@link.Key</a></li>
                }
            </ul>
        </nav>
    </div>
</header>

<div class="body" id="body">
    <main role="main">
        @RenderBody()
    </main>
</div>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
<script src="~/lib/highlight-js/highlight.min.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>