From 2bfd65735f9443615c4a983a1b8fee4bc6a93fcc Mon Sep 17 00:00:00 2001 From: jackfiled Date: Thu, 1 Feb 2024 11:29:03 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=85=AC=E5=91=8A=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YaeBlog.Core/Models/BlogOptions.cs | 2 ++ .../Components/Announcement.razor | 26 +++++++++++++++++++ .../Components/Announcement.razor.css | 4 +++ YaeBlog.Theme.FluentUI/Pages/Home.razor | 6 ++--- 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 YaeBlog.Theme.FluentUI/Components/Announcement.razor create mode 100644 YaeBlog.Theme.FluentUI/Components/Announcement.razor.css diff --git a/YaeBlog.Core/Models/BlogOptions.cs b/YaeBlog.Core/Models/BlogOptions.cs index d804200..6ae6dad 100644 --- a/YaeBlog.Core/Models/BlogOptions.cs +++ b/YaeBlog.Core/Models/BlogOptions.cs @@ -14,6 +14,8 @@ public class BlogOptions /// public required string Author { get; set; } + public required string Announcement { get; set; } + /// /// 博客的起始年份 /// diff --git a/YaeBlog.Theme.FluentUI/Components/Announcement.razor b/YaeBlog.Theme.FluentUI/Components/Announcement.razor new file mode 100644 index 0000000..7d12b58 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Components/Announcement.razor @@ -0,0 +1,26 @@ +@using YaeBlog.Core.Models + +@inject BlogOptions BlogOptionsInstance + +
+ +
+ + + 公告 + +
+ +
+ + + @(BlogOptionsInstance.Announcement) + + +
+
+
+ +@code { + +} diff --git a/YaeBlog.Theme.FluentUI/Components/Announcement.razor.css b/YaeBlog.Theme.FluentUI/Components/Announcement.razor.css new file mode 100644 index 0000000..04490c5 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Components/Announcement.razor.css @@ -0,0 +1,4 @@ +.announcement-title { + display: flex; + align-items: center; +} diff --git a/YaeBlog.Theme.FluentUI/Pages/Home.razor b/YaeBlog.Theme.FluentUI/Pages/Home.razor index 36ec0c2..c11d325 100644 --- a/YaeBlog.Theme.FluentUI/Pages/Home.razor +++ b/YaeBlog.Theme.FluentUI/Pages/Home.razor @@ -27,7 +27,7 @@
- +
@foreach (KeyValuePair essay in _essays) { @@ -126,11 +126,11 @@
- + - +