From 25be0d230256a511676d28c9e4abbaab27f2eb2b Mon Sep 17 00:00:00 2001 From: jackfiled Date: Sat, 20 Jan 2024 17:10:32 +0800 Subject: [PATCH] =?UTF-8?q?add:=20FluentUI=E4=B8=BB=E9=A2=98=E5=8F=8A?= =?UTF-8?q?=E5=85=B6=E4=B8=BB=E9=A2=98=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YaeBlog.Theme.FluentUI/App.razor | 23 ++++++++ .../BlogApplicationBuilderExtensions.cs | 26 +++++++++ .../Layout/MainLayout.razor | 54 +++++++++++++++++++ YaeBlog.Theme.FluentUI/Pages/Home.razor | 8 +++ YaeBlog.Theme.FluentUI/Pages/Home.razor.css | 3 ++ YaeBlog.Theme.FluentUI/Routes.razor | 5 ++ YaeBlog.Theme.FluentUI/wwwroot/globals.css | 3 ++ 7 files changed, 122 insertions(+) create mode 100644 YaeBlog.Theme.FluentUI/App.razor create mode 100644 YaeBlog.Theme.FluentUI/BlogApplicationBuilderExtensions.cs create mode 100644 YaeBlog.Theme.FluentUI/Layout/MainLayout.razor create mode 100644 YaeBlog.Theme.FluentUI/Pages/Home.razor create mode 100644 YaeBlog.Theme.FluentUI/Pages/Home.razor.css create mode 100644 YaeBlog.Theme.FluentUI/Routes.razor create mode 100644 YaeBlog.Theme.FluentUI/wwwroot/globals.css diff --git a/YaeBlog.Theme.FluentUI/App.razor b/YaeBlog.Theme.FluentUI/App.razor new file mode 100644 index 0000000..23e8177 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/App.razor @@ -0,0 +1,23 @@ +@using YaeBlog.Core.Models +@inject BlogOptions BlogOptionsInstance + + + + + + + + + + + + + + + + + + + + + diff --git a/YaeBlog.Theme.FluentUI/BlogApplicationBuilderExtensions.cs b/YaeBlog.Theme.FluentUI/BlogApplicationBuilderExtensions.cs new file mode 100644 index 0000000..17bc010 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/BlogApplicationBuilderExtensions.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using YaeBlog.Core.Builder; +using YaeBlog.Core.Extensions; + +namespace YaeBlog.Theme.FluentUI; + +public static class BlogApplicationBuilderExtensions +{ + public static void UseFluentTheme(this BlogApplicationBuilder builder) + { + builder.ConfigureWebApplication(ConfigureWebApplicationBuilder, ConfigureWebApplication); + } + + private static void ConfigureWebApplicationBuilder(WebApplicationBuilder builder) + { + builder.Services.AddRazorComponents(); + } + + private static void ConfigureWebApplication(WebApplication application) + { + application.UseStaticFiles(); + application.UseAntiforgery(); + application.MapRazorComponents(); + } +} diff --git a/YaeBlog.Theme.FluentUI/Layout/MainLayout.razor b/YaeBlog.Theme.FluentUI/Layout/MainLayout.razor new file mode 100644 index 0000000..e1af66e --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Layout/MainLayout.razor @@ -0,0 +1,54 @@ +@inherits LayoutComponentBase + + + + +
+ + + + Ricardo Ren + + + + + + + + 首页 + + + + + + 归档 + + + + + + 标签 + + + + + + 关于 + + + + + + 友链 + + + +
+
+
+ +
+ @Body +
+
+
diff --git a/YaeBlog.Theme.FluentUI/Pages/Home.razor b/YaeBlog.Theme.FluentUI/Pages/Home.razor new file mode 100644 index 0000000..e8a367e --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Pages/Home.razor @@ -0,0 +1,8 @@ +@page "/" +

Home

+ +

Color Text

+ +@code { + +} diff --git a/YaeBlog.Theme.FluentUI/Pages/Home.razor.css b/YaeBlog.Theme.FluentUI/Pages/Home.razor.css new file mode 100644 index 0000000..9e07b97 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Pages/Home.razor.css @@ -0,0 +1,3 @@ +.test { + color: purple; +} diff --git a/YaeBlog.Theme.FluentUI/Routes.razor b/YaeBlog.Theme.FluentUI/Routes.razor new file mode 100644 index 0000000..acb0e45 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/Routes.razor @@ -0,0 +1,5 @@ + + + + + diff --git a/YaeBlog.Theme.FluentUI/wwwroot/globals.css b/YaeBlog.Theme.FluentUI/wwwroot/globals.css new file mode 100644 index 0000000..e861f02 --- /dev/null +++ b/YaeBlog.Theme.FluentUI/wwwroot/globals.css @@ -0,0 +1,3 @@ +body a { + text-decoration: none; +}