diff --git a/src/Opw.PineBlog.Abstractions/PineBlogOptions.cs b/src/Opw.PineBlog.Abstractions/PineBlogOptions.cs index 27cb998..3aa9469 100644 --- a/src/Opw.PineBlog.Abstractions/PineBlogOptions.cs +++ b/src/Opw.PineBlog.Abstractions/PineBlogOptions.cs @@ -18,6 +18,11 @@ public class PineBlogOptions /// public string Version { get; set; } + /// + /// The theme for the blog, defaults to "default". + /// + public string Theme { get; set; } = "default"; + /// /// Cover URL. /// diff --git a/src/Opw.PineBlog.RazorPages/Areas/Blog/Pages/Shared/_BlogLayout.cshtml b/src/Opw.PineBlog.RazorPages/Areas/Blog/Pages/Shared/_BlogLayout.cshtml index b8a54ed..be8c980 100644 --- a/src/Opw.PineBlog.RazorPages/Areas/Blog/Pages/Shared/_BlogLayout.cshtml +++ b/src/Opw.PineBlog.RazorPages/Areas/Blog/Pages/Shared/_BlogLayout.cshtml @@ -1,22 +1,23 @@ @{ Layout = "_Layout"; + var theme = ViewData["PineBlogTheme"]; } @section head { - + - + @RenderSection("head", required: false) } @section scripts { - + - + @RenderSection("scripts", required: false) } diff --git a/src/Opw.PineBlog.RazorPages/PineBlogViewDataAsyncResultFilter.cs b/src/Opw.PineBlog.RazorPages/PineBlogViewDataAsyncResultFilter.cs index 29ffb56..4a6f6c2 100644 --- a/src/Opw.PineBlog.RazorPages/PineBlogViewDataAsyncResultFilter.cs +++ b/src/Opw.PineBlog.RazorPages/PineBlogViewDataAsyncResultFilter.cs @@ -39,6 +39,7 @@ public async Task OnPageHandlerExecutionAsync(PageHandlerExecutingContext contex } pageModel.ViewData["PineBlogVersion"] = _options.Value.Version; + pageModel.ViewData["PineBlogTheme"] = _options.Value.Theme; pageModel.ViewData["Title"] = _options.Value.Title; await next();