diff --git a/.gitignore b/.gitignore
index 104b544..f606da8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -482,3 +482,6 @@ $RECYCLE.BIN/
# Vim temporary swap files
*.swp
+
+# Tailwind auto-generated stylesheet
+output.css
diff --git a/YaeBlog.Core/Components/_Imports.razor b/YaeBlog.Core/Components/_Imports.razor
deleted file mode 100644
index d88eed9..0000000
--- a/YaeBlog.Core/Components/_Imports.razor
+++ /dev/null
@@ -1,8 +0,0 @@
-@using System.Net.Http
-@using System.Net.Http.Json
-@using Microsoft.AspNetCore.Components.Forms
-@using Microsoft.AspNetCore.Components.Routing
-@using Microsoft.AspNetCore.Components.Web
-@using static Microsoft.AspNetCore.Components.Web.RenderMode
-@using Microsoft.AspNetCore.Components.Web.Virtualization
-@using Microsoft.JSInterop
diff --git a/YaeBlog.Core/YaeBlog.Core.csproj b/YaeBlog.Core/YaeBlog.Core.csproj
deleted file mode 100644
index 7089599..0000000
--- a/YaeBlog.Core/YaeBlog.Core.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- net9.0
- enable
- enable
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/YaeBlog.sln b/YaeBlog.sln
index 78aae25..c4f8f9c 100644
--- a/YaeBlog.sln
+++ b/YaeBlog.sln
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "YaeBlog.Core", "YaeBlog.Core\YaeBlog.Core.csproj", "{1671A8AE-78F6-4641-B97D-D8ABA5E9CBEF}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YaeBlog", "YaeBlog\YaeBlog.csproj", "{20438EFD-8DDE-43AF-92E2-76495C29233C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".gitea", ".gitea", "{9B5AAA29-37D8-454A-8D8F-3E6B6BCF38E6}"
@@ -29,10 +27,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {1671A8AE-78F6-4641-B97D-D8ABA5E9CBEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1671A8AE-78F6-4641-B97D-D8ABA5E9CBEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1671A8AE-78F6-4641-B97D-D8ABA5E9CBEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1671A8AE-78F6-4641-B97D-D8ABA5E9CBEF}.Release|Any CPU.Build.0 = Release|Any CPU
{20438EFD-8DDE-43AF-92E2-76495C29233C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20438EFD-8DDE-43AF-92E2-76495C29233C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20438EFD-8DDE-43AF-92E2-76495C29233C}.Release|Any CPU.ActiveCfg = Release|Any CPU
diff --git a/YaeBlog.Core/Abstractions/IEssayContentService.cs b/YaeBlog/Abstraction/IEssayContentService.cs
similarity index 89%
rename from YaeBlog.Core/Abstractions/IEssayContentService.cs
rename to YaeBlog/Abstraction/IEssayContentService.cs
index 9be561c..2845c75 100644
--- a/YaeBlog.Core/Abstractions/IEssayContentService.cs
+++ b/YaeBlog/Abstraction/IEssayContentService.cs
@@ -1,7 +1,7 @@
using System.Diagnostics.CodeAnalysis;
-using YaeBlog.Core.Models;
+using YaeBlog.Models;
-namespace YaeBlog.Core.Abstractions;
+namespace YaeBlog.Abstraction;
public interface IEssayContentService
{
diff --git a/YaeBlog.Core/Abstractions/IEssayScanService.cs b/YaeBlog/Abstraction/IEssayScanService.cs
similarity index 75%
rename from YaeBlog.Core/Abstractions/IEssayScanService.cs
rename to YaeBlog/Abstraction/IEssayScanService.cs
index 5395b9a..f5aad84 100644
--- a/YaeBlog.Core/Abstractions/IEssayScanService.cs
+++ b/YaeBlog/Abstraction/IEssayScanService.cs
@@ -1,6 +1,6 @@
-using YaeBlog.Core.Models;
+using YaeBlog.Models;
-namespace YaeBlog.Core.Abstractions;
+namespace YaeBlog.Abstraction;
public interface IEssayScanService
{
diff --git a/YaeBlog.Core/Abstractions/IPostRenderProcessor.cs b/YaeBlog/Abstraction/IPostRenderProcessor.cs
similarity index 64%
rename from YaeBlog.Core/Abstractions/IPostRenderProcessor.cs
rename to YaeBlog/Abstraction/IPostRenderProcessor.cs
index 6117742..e7b4c2b 100644
--- a/YaeBlog.Core/Abstractions/IPostRenderProcessor.cs
+++ b/YaeBlog/Abstraction/IPostRenderProcessor.cs
@@ -1,6 +1,6 @@
-using YaeBlog.Core.Models;
+using YaeBlog.Models;
-namespace YaeBlog.Core.Abstractions;
+namespace YaeBlog.Abstraction;
public interface IPostRenderProcessor
{
diff --git a/YaeBlog.Core/Abstractions/IPreRenderProcessor.cs b/YaeBlog/Abstraction/IPreRenderProcessor.cs
similarity index 65%
rename from YaeBlog.Core/Abstractions/IPreRenderProcessor.cs
rename to YaeBlog/Abstraction/IPreRenderProcessor.cs
index ee3b7f2..a9b69f2 100644
--- a/YaeBlog.Core/Abstractions/IPreRenderProcessor.cs
+++ b/YaeBlog/Abstraction/IPreRenderProcessor.cs
@@ -1,6 +1,6 @@
-using YaeBlog.Core.Models;
+using YaeBlog.Models;
-namespace YaeBlog.Core.Abstractions;
+namespace YaeBlog.Abstraction;
public interface IPreRenderProcessor
{
diff --git a/YaeBlog/Commands/Binders/BlogOptionsBinder.cs b/YaeBlog/Commands/Binders/BlogOptionsBinder.cs
index 9f3cb54..f6e4af6 100644
--- a/YaeBlog/Commands/Binders/BlogOptionsBinder.cs
+++ b/YaeBlog/Commands/Binders/BlogOptionsBinder.cs
@@ -1,7 +1,7 @@
using System.CommandLine.Binding;
using System.Text.Json;
using Microsoft.Extensions.Options;
-using YaeBlog.Core.Models;
+using YaeBlog.Models;
namespace YaeBlog.Commands.Binders;
diff --git a/YaeBlog/Commands/Binders/EssayScanServiceBinder.cs b/YaeBlog/Commands/Binders/EssayScanServiceBinder.cs
index b0613c8..5d7e1d5 100644
--- a/YaeBlog/Commands/Binders/EssayScanServiceBinder.cs
+++ b/YaeBlog/Commands/Binders/EssayScanServiceBinder.cs
@@ -1,8 +1,8 @@
using System.CommandLine.Binding;
using Microsoft.Extensions.Options;
-using YaeBlog.Core.Abstractions;
-using YaeBlog.Core.Models;
-using YaeBlog.Core.Services;
+using YaeBlog.Abstraction;
+using YaeBlog.Models;
+using YaeBlog.Services;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
diff --git a/YaeBlog/Commands/CommandExtensions.cs b/YaeBlog/Commands/YaeBlogCommand.cs
similarity index 88%
rename from YaeBlog/Commands/CommandExtensions.cs
rename to YaeBlog/Commands/YaeBlogCommand.cs
index bb7576d..88c4043 100644
--- a/YaeBlog/Commands/CommandExtensions.cs
+++ b/YaeBlog/Commands/YaeBlogCommand.cs
@@ -1,15 +1,32 @@
using System.CommandLine;
using YaeBlog.Commands.Binders;
using YaeBlog.Components;
-using YaeBlog.Core.Extensions;
-using YaeBlog.Core.Models;
-using YaeBlog.Core.Services;
+using YaeBlog.Extensions;
+using YaeBlog.Models;
+using YaeBlog.Services;
namespace YaeBlog.Commands;
-public static class CommandExtensions
+public sealed class YaeBlogCommand
{
- public static void AddServeCommand(this RootCommand rootCommand)
+ private readonly RootCommand _rootCommand = new("YaeBlog Cli");
+
+ public YaeBlogCommand()
+ {
+ AddServeCommand(_rootCommand);
+ AddWatchCommand(_rootCommand);
+ AddListCommand(_rootCommand);
+ AddNewCommand(_rootCommand);
+ AddPublishCommand(_rootCommand);
+ AddScanCommand(_rootCommand);
+ }
+
+ public Task RunAsync(string[] args)
+ {
+ return _rootCommand.InvokeAsync(args);
+ }
+
+ private static void AddServeCommand(RootCommand rootCommand)
{
Command serveCommand = new("serve", "Start http server.");
rootCommand.AddCommand(serveCommand);
@@ -21,7 +38,6 @@ public static class CommandExtensions
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddControllers();
- builder.Services.AddBlazorBootstrap();
builder.AddYaeBlog();
builder.AddServer();
@@ -40,7 +56,7 @@ public static class CommandExtensions
});
}
- public static void AddWatchCommand(this RootCommand rootCommand)
+ private static void AddWatchCommand(RootCommand rootCommand)
{
Command command = new("watch", "Start a blog watcher that re-render when file changes.");
rootCommand.AddCommand(command);
@@ -52,9 +68,9 @@ public static class CommandExtensions
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddControllers();
- builder.Services.AddBlazorBootstrap();
builder.AddYaeBlog();
builder.AddWatcher();
+ builder.AddTailwindWatcher();
WebApplication application = builder.Build();
@@ -71,7 +87,7 @@ public static class CommandExtensions
});
}
- public static void AddNewCommand(this RootCommand rootCommand)
+ private static void AddNewCommand(RootCommand rootCommand)
{
Command newCommand = new("new", "Create a new blog file and image directory.");
rootCommand.AddCommand(newCommand);
@@ -101,7 +117,7 @@ public static class CommandExtensions
new EssayScanServiceBinder());
}
- public static void AddListCommand(this RootCommand rootCommand)
+ private static void AddListCommand(RootCommand rootCommand)
{
Command command = new("list", "List all blogs");
rootCommand.AddCommand(command);
@@ -124,7 +140,7 @@ public static class CommandExtensions
}, new BlogOptionsBinder(), new LoggerBinder(), new EssayScanServiceBinder());
}
- public static void AddScanCommand(this RootCommand rootCommand)
+ private static void AddScanCommand(RootCommand rootCommand)
{
Command command = new("scan", "Scan unused and not found images.");
rootCommand.AddCommand(command);
@@ -165,7 +181,7 @@ public static class CommandExtensions
}, new BlogOptionsBinder(), new LoggerBinder(), new EssayScanServiceBinder(), removeOption);
}
- public static void AddPublishCommand(this RootCommand rootCommand)
+ private static void AddPublishCommand(RootCommand rootCommand)
{
Command command = new("publish", "Publish a new blog file.");
rootCommand.AddCommand(command);
diff --git a/YaeBlog/Components/App.razor b/YaeBlog/Components/App.razor
index 3a96ded..a30f2cd 100644
--- a/YaeBlog/Components/App.razor
+++ b/YaeBlog/Components/App.razor
@@ -7,10 +7,8 @@
-
-
-
+
@@ -18,7 +16,6 @@
-