refact: Fully refactor the conceptional structure and functional behaviour.
This commit is contained in:
26
YaeBlog/Components/Announcement.razor
Normal file
26
YaeBlog/Components/Announcement.razor
Normal file
@@ -0,0 +1,26 @@
|
||||
@using YaeBlog.Core.Models
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
|
||||
<div style="width: 100%">
|
||||
<FluentCard>
|
||||
<div class="announcement-title">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Note())" />
|
||||
<FluentLabel Typo="@Typography.H5" Style="margin-left: 0.5rem">
|
||||
公告
|
||||
</FluentLabel>
|
||||
</div>
|
||||
|
||||
<div style="height: 1rem"></div>
|
||||
|
||||
<FluentLabel>
|
||||
@(BlogOptionsInstance.Announcement)
|
||||
</FluentLabel>
|
||||
|
||||
<div style="height: 0.5rem"></div>
|
||||
</FluentCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
4
YaeBlog/Components/Announcement.razor.css
Normal file
4
YaeBlog/Components/Announcement.razor.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.announcement-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
20
YaeBlog/Components/App.razor
Normal file
20
YaeBlog/Components/App.razor
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<base href="/"/>
|
||||
<link rel="stylesheet" href="YaeBlog.styles.css"/>
|
||||
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
|
||||
<link href="globals.css" rel="stylesheet"/>
|
||||
<HeadOutlet/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<Routes/>
|
||||
<script src="_framework/blazor.web.js"></script>
|
||||
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
|
||||
</body>
|
||||
|
||||
</html>
|
53
YaeBlog/Components/AuthorInformation.razor
Normal file
53
YaeBlog/Components/AuthorInformation.razor
Normal file
@@ -0,0 +1,53 @@
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContentInstance
|
||||
|
||||
<div style="margin: 2rem 0; width: 100%">
|
||||
<FluentCard>
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<div class="about-avatar">
|
||||
<img src="@(BlogOptionsInstance.About.AvatarImage)" alt="author-avatar"
|
||||
class="about-avatar-img">
|
||||
</div>
|
||||
<FluentLabel Typo="@Typography.H3">
|
||||
@(BlogOptionsInstance.Author)
|
||||
</FluentLabel>
|
||||
|
||||
<div style="height: 0.5rem"></div>
|
||||
|
||||
<FluentStack Orientation="@Orientation.Horizontal"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center"
|
||||
HorizontalGap="20">
|
||||
<a href="archives">
|
||||
<div>
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
文章
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
@(EssayContentInstance.Count)
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
<a href="tags">
|
||||
<div>
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
标签
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
@(EssayContentInstance.TagCount)
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
</FluentStack>
|
||||
</FluentStack>
|
||||
</FluentCard>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
30
YaeBlog/Components/AuthorInformation.razor.css
Normal file
30
YaeBlog/Components/AuthorInformation.razor.css
Normal file
@@ -0,0 +1,30 @@
|
||||
.about-avatar {
|
||||
position: relative;
|
||||
width: 6rem;
|
||||
height: 6rem;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.about-avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: transparent;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
|
||||
0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.about-avatar-img:hover {
|
||||
animation: rotate-animation 1s ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes rotate-animation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
33
YaeBlog/Components/BlogFooter.razor
Normal file
33
YaeBlog/Components/BlogFooter.razor
Normal file
@@ -0,0 +1,33 @@
|
||||
@using YaeBlog.Core.Models
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
|
||||
<div class="footer-content">
|
||||
<div>
|
||||
<a href="https://learn.microsoft.com/zh-cn/aspnet/core/blazor/" target="_blank" rel="nofollow noopener">
|
||||
<span> Blazor </span>
|
||||
</a>
|
||||
<i class="love-tag"></i>
|
||||
<span> YaeBlog </span>
|
||||
<i class="love-tag"></i>
|
||||
<span>FluentUI</span>
|
||||
</div>
|
||||
|
||||
<div style="padding-top: 0.3rem">
|
||||
<span>
|
||||
©@(BlogOptionsInstance.StartYear) - @(DateTime.Now.Year) By @(BlogOptionsInstance.Author)
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if (!string.IsNullOrEmpty(BlogOptionsInstance.RegisterInformation))
|
||||
{
|
||||
<div style="padding-top: 0.3rem">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
|
||||
<span>@(BlogOptionsInstance.RegisterInformation)</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
14
YaeBlog/Components/BlogFooter.razor.css
Normal file
14
YaeBlog/Components/BlogFooter.razor.css
Normal file
@@ -0,0 +1,14 @@
|
||||
.footer-content {
|
||||
padding: 2rem 0 1rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.love-tag {
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-family: "Font Awesome 6 Free", sans-serif;
|
||||
}
|
||||
|
||||
.love-tag::before {
|
||||
content: "\f004";
|
||||
}
|
6
YaeBlog/Components/Routes.razor
Normal file
6
YaeBlog/Components/Routes.razor
Normal file
@@ -0,0 +1,6 @@
|
||||
<Router AppAssembly="typeof(Program).Assembly">
|
||||
<Found Context="routeData">
|
||||
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)"/>
|
||||
<FocusOnNavigate RouteData="routeData" Selector="h1"/>
|
||||
</Found>
|
||||
</Router>
|
28
YaeBlog/Controllers/FilesController.cs
Normal file
28
YaeBlog/Controllers/FilesController.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace YaeBlog.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/files")]
|
||||
public class FilesController : ControllerBase
|
||||
{
|
||||
[HttpGet("{*filename}")]
|
||||
public IActionResult Images(string filename)
|
||||
{
|
||||
string contentType = "image/png";
|
||||
if (filename.EndsWith("jpg") || filename.EndsWith("jpeg"))
|
||||
{
|
||||
contentType = "image/jpeg";
|
||||
}
|
||||
|
||||
FileInfo imageFile = new(filename);
|
||||
|
||||
if (!imageFile.Exists)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
Stream imageStream = imageFile.OpenRead();
|
||||
return File(imageStream, contentType);
|
||||
}
|
||||
}
|
77
YaeBlog/Layout/MainLayout.razor
Normal file
77
YaeBlog/Layout/MainLayout.razor
Normal file
@@ -0,0 +1,77 @@
|
||||
@using YaeBlog.Core.Models
|
||||
@inherits LayoutComponentBase
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
|
||||
<FluentLayout>
|
||||
<FluentHeader>
|
||||
<FluentStack Orientation="@Orientation.Horizontal">
|
||||
<div style="width: 50px"></div>
|
||||
|
||||
<a href="./">
|
||||
<FluentLabel Typo="@Typography.H3" Color="@Color.Lightweight">
|
||||
@BlogOptionsInstance.Author
|
||||
</FluentLabel>
|
||||
</a>
|
||||
|
||||
<FluentSpacer/>
|
||||
|
||||
<a href="./" style="margin: auto 0 auto 0">
|
||||
<div class="quick-link">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Home())" Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Color="@Color.Lightweight"
|
||||
Style="margin-left: 0.2rem">
|
||||
首页
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="archives" style="margin: auto 0 auto 0">
|
||||
<div class="quick-link">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Archive())" Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Color="@Color.Lightweight"
|
||||
Style="margin-left: 0.2rem">
|
||||
归档
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="tags" style="margin: auto 0 auto 0">
|
||||
<div class="quick-link">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Tag())" Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Color="@Color.Lightweight"
|
||||
Style="margin-left: 0.2rem">
|
||||
标签
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="about" style="margin: auto 0 auto 0">
|
||||
<div class="quick-link">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.PersonInfo())" Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Color="@Color.Lightweight"
|
||||
Style="margin-left: 0.2rem">
|
||||
关于
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="links" style="margin: auto 0 auto 0">
|
||||
<div class="quick-link">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.LinkMultiple())" Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Color="@Color.Lightweight"
|
||||
Style="margin-left: 0.2rem">
|
||||
友链
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div style="width: 20px"></div>
|
||||
</FluentStack>
|
||||
</FluentHeader>
|
||||
<FluentBodyContent Style="height: 100%">
|
||||
<main style="height: 100%">
|
||||
@Body
|
||||
</main>
|
||||
</FluentBodyContent>
|
||||
</FluentLayout>
|
4
YaeBlog/Layout/MainLayout.razor.css
Normal file
4
YaeBlog/Layout/MainLayout.razor.css
Normal file
@@ -0,0 +1,4 @@
|
||||
.quick-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
42
YaeBlog/Pages/About.razor
Normal file
42
YaeBlog/Pages/About.razor
Normal file
@@ -0,0 +1,42 @@
|
||||
@page "/about"
|
||||
@using YaeBlog.Core.Models
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
|
||||
<PageTitle>
|
||||
关于 - @(BlogOptionsInstance.Author)
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="about-background" style="background-image: url('@(BlogOptionsInstance.EssayImage)')">
|
||||
<div class="about-content">
|
||||
<FluentCard>
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<div class="about-avatar">
|
||||
<img src="@(BlogOptionsInstance.About.AvatarImage)" alt="author-avatar"
|
||||
class="about-avatar-img">
|
||||
</div>
|
||||
<FluentLabel Typo="@Typography.H2">
|
||||
@(BlogOptionsInstance.Author)
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.Body">
|
||||
@(BlogOptionsInstance.About.Introduction)
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
|
||||
<div style="height: 2rem"></div>
|
||||
<FluentLabel Typo="@Typography.Body">
|
||||
@(BlogOptionsInstance.About.Description)
|
||||
</FluentLabel>
|
||||
</FluentCard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
45
YaeBlog/Pages/About.razor.css
Normal file
45
YaeBlog/Pages/About.razor.css
Normal file
@@ -0,0 +1,45 @@
|
||||
.about-background {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.about-content {
|
||||
top: 33%;
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
margin: 0 10%;
|
||||
}
|
||||
|
||||
.about-avatar {
|
||||
position: relative;
|
||||
width: 10rem;
|
||||
height: 10rem;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.about-avatar-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: transparent;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16),
|
||||
0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.about-avatar-img:hover {
|
||||
animation: rotate-animation 1s ease-in-out;
|
||||
}
|
||||
|
||||
@keyframes rotate-animation {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
78
YaeBlog/Pages/Archives.razor
Normal file
78
YaeBlog/Pages/Archives.razor
Normal file
@@ -0,0 +1,78 @@
|
||||
@page "/archives"
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContentInstance
|
||||
|
||||
<PageTitle>
|
||||
存档
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="archive-background" style="background-image: url('@(BlogOptionsInstance.EssayImage)')">
|
||||
<div class="archive-title">
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<FluentLabel Typo="@Typography.H1" Color="@Color.Fill">
|
||||
存 档
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 2rem"></div>
|
||||
|
||||
<div style="margin: 0 8% 0 8%">
|
||||
<FluentCard>
|
||||
<div style="margin: 0 8% 0 8%">
|
||||
<FluentLabel Typo="@Typography.H2" Style="margin: 3rem 0 2rem 0; color: #404853">
|
||||
共计@(EssayContentInstance.Count)篇文章
|
||||
</FluentLabel>
|
||||
|
||||
@foreach (IGrouping<DateTime, KeyValuePair<string, BlogEssay>> group in _essays)
|
||||
{
|
||||
<FluentLabel Typo="@Typography.H3" Style="color: #718096; margin: 2rem 0 1rem 0">
|
||||
@(group.Key.ToString("yyyy年"))
|
||||
</FluentLabel>
|
||||
|
||||
<div style="margin: 0 4% 0 4%">
|
||||
@foreach (KeyValuePair<string, BlogEssay> pair in group)
|
||||
{
|
||||
<div class="archive-item">
|
||||
<a href="essays/@(pair.Key)" target="_blank">
|
||||
<FluentStack Orientation="@Orientation.Horizontal">
|
||||
<FluentLabel Typo="@Typography.H5" Style="width: 80px">
|
||||
@(pair.Value.PublishTime.ToString("MM-dd"))
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.H5">
|
||||
@(pair.Value.Title)
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</FluentCard>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private readonly List<IGrouping<DateTime, KeyValuePair<string, BlogEssay>>> _essays = [];
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
IEnumerable<IGrouping<DateTime, KeyValuePair<string, BlogEssay>>> essays =
|
||||
from essay in EssayContentInstance.Essays
|
||||
orderby essay.Value.PublishTime descending
|
||||
group essay by new DateTime(essay.Value.PublishTime.Year, 1, 1);
|
||||
|
||||
_essays.AddRange(essays);
|
||||
}
|
||||
|
||||
}
|
24
YaeBlog/Pages/Archives.razor.css
Normal file
24
YaeBlog/Pages/Archives.razor.css
Normal file
@@ -0,0 +1,24 @@
|
||||
.archive-background {
|
||||
position: relative;
|
||||
height: 60%;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.archive-title {
|
||||
top: 43%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.archive-item {
|
||||
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
|
||||
margin: 0.5rem 0 0.5rem 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.archive-item:hover {
|
||||
background-color: rgba(169, 169, 169, 0.22);
|
||||
}
|
||||
|
36
YaeBlog/Pages/Error.razor
Normal file
36
YaeBlog/Pages/Error.razor
Normal file
@@ -0,0 +1,36 @@
|
||||
@page "/Error"
|
||||
@using System.Diagnostics
|
||||
|
||||
<PageTitle>Error</PageTitle>
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
|
||||
@code{
|
||||
[CascadingParameter] private HttpContext? HttpContext { get; set; }
|
||||
|
||||
private string? RequestId { get; set; }
|
||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
protected override void OnInitialized() =>
|
||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||
|
||||
}
|
83
YaeBlog/Pages/Essay.razor
Normal file
83
YaeBlog/Pages/Essay.razor
Normal file
@@ -0,0 +1,83 @@
|
||||
@page "/essays/{Filename}"
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContent
|
||||
@inject NavigationManager NavigationInstance
|
||||
|
||||
<PageTitle>
|
||||
@(_essay!.Title)
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="essay-background" style="background-image: url('@(BlogOptionsInstance.EssayImage)')">
|
||||
<div class="essay-title">
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<FluentLabel Typo="@Typography.H1" Style="color: white">
|
||||
@(_essay!.Title)
|
||||
</FluentLabel>
|
||||
<div class="essay-subtitle">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Calendar())"
|
||||
Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Style="color: white; margin-left: 0.25rem">
|
||||
@(_essay!.PublishTime.ToString("yyyy年MM月dd日"))
|
||||
</FluentLabel>
|
||||
</div>
|
||||
<div class="essay-subtitle">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.DataBarVerticalAscending())"
|
||||
Color="@Color.Fill"/>
|
||||
<FluentLabel Typo="@Typography.H5" Style="color: white; margin-left: 0.25rem">
|
||||
@(_essay!.WordCount)字
|
||||
</FluentLabel>
|
||||
</div>
|
||||
</FluentStack>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 2rem"></div>
|
||||
|
||||
<div style="margin: 0 8% 0 8%">
|
||||
<FluentGrid>
|
||||
<FluentGridItem xs="12" sm="12" md="8" lg="8">
|
||||
<FluentCard Style="margin: 2rem 0">
|
||||
<div class="essay-content">
|
||||
@((MarkupString)_essay!.HtmlContent)
|
||||
</div>
|
||||
</FluentCard>
|
||||
</FluentGridItem>
|
||||
|
||||
<FluentGridItem xs="12" sm="12" md="4" lg="4">
|
||||
<FluentStack Orientation="@Orientation.Vertical">
|
||||
<AuthorInformation/>
|
||||
|
||||
<Announcement/>
|
||||
</FluentStack>
|
||||
</FluentGridItem>
|
||||
</FluentGrid>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public string? Filename { get; set; }
|
||||
|
||||
private BlogEssay? _essay;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Filename))
|
||||
{
|
||||
NavigationInstance.NavigateTo("NotFound");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EssayContent.TryGet(Filename, out _essay))
|
||||
{
|
||||
NavigationInstance.NavigateTo("NotFound");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
24
YaeBlog/Pages/Essay.razor.css
Normal file
24
YaeBlog/Pages/Essay.razor.css
Normal file
@@ -0,0 +1,24 @@
|
||||
.essay-background {
|
||||
position: relative;
|
||||
height: 80%;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.essay-title {
|
||||
color: white;
|
||||
top: 43%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.essay-content {
|
||||
font-size: 1rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.essay-subtitle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
179
YaeBlog/Pages/Home.razor
Normal file
179
YaeBlog/Pages/Home.razor
Normal file
@@ -0,0 +1,179 @@
|
||||
@page "/"
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContentInstance
|
||||
@inject NavigationManager NavigationManagerInstance
|
||||
|
||||
<PageTitle>
|
||||
@(BlogOptionsInstance.Author)'s Blog
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="banner" style="background-image: url('@BlogOptionsInstance.BannerImage')">
|
||||
<div class="blog-title">
|
||||
<FluentLabel Typo="@Typography.H1" Style="color: white">
|
||||
@(BlogOptionsInstance.Author)'s Blog
|
||||
</FluentLabel>
|
||||
</div>
|
||||
|
||||
<div class="scroll-down">
|
||||
<i class="scroll-down-tag"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 2rem" id="blog-content"></div>
|
||||
|
||||
<div style="margin: 0 8% 0 8%">
|
||||
<FluentGrid>
|
||||
<FluentGridItem xs="12" sm="12" md="9" lg="9">
|
||||
<div>
|
||||
@foreach (KeyValuePair<string, BlogEssay> essay in _essays)
|
||||
{
|
||||
<FluentCard Style="margin: 2rem 0 2rem 0">
|
||||
<div>
|
||||
<a href="essays/@(essay.Key)" target="_blank">
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
@(essay.Value.Title)
|
||||
</FluentLabel>
|
||||
</a>
|
||||
|
||||
<div style="margin: 0.5rem 0 0.5rem 0">
|
||||
<a href="essays/@(essay.Key)" target="_blank" style="color: #718096;">
|
||||
<div class="essay-description">
|
||||
@(essay.Value.Description)
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<FluentStack VerticalAlignment="@VerticalAlignment.Center"
|
||||
Style="margin: 1rem 0 1rem 0"
|
||||
HorizontalGap="4">
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.Calendar())"/>
|
||||
<span style="margin: auto 0 auto 0">
|
||||
@(essay.Value.PublishTime.ToString("yyyy-MM-dd HH:mm:ss"))
|
||||
</span>
|
||||
@if (essay.Value.Tags.Count != 0)
|
||||
{
|
||||
<FluentIcon Value="@(new Icons.Regular.Size16.TagMultiple())"/>
|
||||
@foreach (string tag in essay.Value.Tags)
|
||||
{
|
||||
<span style="margin: auto 0 auto 0">
|
||||
@tag
|
||||
</span>
|
||||
}
|
||||
}
|
||||
</FluentStack>
|
||||
</div>
|
||||
</FluentCard>
|
||||
}
|
||||
|
||||
<div class="pagination">
|
||||
<FluentStack HorizontalAlignment="@HorizontalAlignment.Center"
|
||||
HorizontalGap="20">
|
||||
@if (Page != 1)
|
||||
{
|
||||
<a href="./?page=@(Page - 1)#blog-content" class="pagination-item">
|
||||
<i class="chevron-left"></i>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (Page == 1)
|
||||
{
|
||||
<a href="./?page=1#blog-content" class="pagination-item">
|
||||
<span>1</span>
|
||||
</a>
|
||||
<a href="./?page=2#blog-content" class="pagination-item">
|
||||
<span>2</span>
|
||||
</a>
|
||||
<a href="./?page=3#blog-content" class="pagination-item">
|
||||
<span>3</span>
|
||||
</a>
|
||||
}
|
||||
else if (Page == _pageCount)
|
||||
{
|
||||
<a href="./?page=@(_pageCount - 2)#blog-content" class="pagination-item">
|
||||
<span>@(_pageCount - 2)</span>
|
||||
</a>
|
||||
<a href="./?page=@(_pageCount - 1)#blog-content" class="pagination-item">
|
||||
<span>@(_pageCount - 1)</span>
|
||||
</a>
|
||||
<a href="./?page=@(_pageCount)#blog-content" class="pagination-item">
|
||||
<span>@(_pageCount)</span>
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a href="./?page=@(Page - 1)#blog-content" class="pagination-item">
|
||||
<span>@(Page - 1)</span>
|
||||
</a>
|
||||
<a href="./?page=@(Page)#blog-content" class="pagination-item">
|
||||
<span>@(Page)</span>
|
||||
</a>
|
||||
<a href="./?page=@(Page + 1)#blog-content" class="pagination-item">
|
||||
<span>@(Page + 1)</span>
|
||||
</a>
|
||||
}
|
||||
|
||||
@if (Page != _pageCount)
|
||||
{
|
||||
<a href="./?page=@(Page + 1)#blog-content" class="pagination-item">
|
||||
<i class="chevron-right"></i>
|
||||
</a>
|
||||
}
|
||||
</FluentStack>
|
||||
</div>
|
||||
</div>
|
||||
</FluentGridItem>
|
||||
<FluentGridItem xs="12" sm="12" md="3" lg="3">
|
||||
<FluentStack Orientation="@Orientation.Vertical">
|
||||
<AuthorInformation/>
|
||||
|
||||
<Announcement/>
|
||||
</FluentStack>
|
||||
</FluentGridItem>
|
||||
</FluentGrid>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromQuery] private int? Page { get; set; }
|
||||
|
||||
private readonly List<KeyValuePair<string, BlogEssay>> _essays = [];
|
||||
private int _pageCount;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Page ??= 1;
|
||||
|
||||
IEnumerable<KeyValuePair<string, BlogEssay>[]> chunks =
|
||||
EssayContentInstance.Essays
|
||||
.OrderByDescending(pair => pair.Value.PublishTime)
|
||||
.Chunk(10);
|
||||
|
||||
var count = 1;
|
||||
var flag = false;
|
||||
foreach (KeyValuePair<string, BlogEssay>[] chunk in chunks)
|
||||
{
|
||||
if (Page == count)
|
||||
{
|
||||
flag = true;
|
||||
_essays.AddRange(chunk);
|
||||
}
|
||||
|
||||
count += 1;
|
||||
}
|
||||
|
||||
_pageCount = count - 1;
|
||||
|
||||
if (flag is false)
|
||||
{
|
||||
NavigationManagerInstance.NavigateTo("NotFount");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
96
YaeBlog/Pages/Home.razor.css
Normal file
96
YaeBlog/Pages/Home.razor.css
Normal file
@@ -0,0 +1,96 @@
|
||||
.banner {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.blog-title {
|
||||
color: white;
|
||||
text-align: center;
|
||||
top: 43%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scroll-down {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scroll-down-tag {
|
||||
font-family: "Font Awesome 6 Free", sans-serif;
|
||||
font-size: 36px;
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
color: white;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
animation: scroll-down-animation 1.5s infinite;
|
||||
}
|
||||
|
||||
.scroll-down-tag::before {
|
||||
content: "\f107";
|
||||
}
|
||||
|
||||
@keyframes scroll-down-animation {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
50% {
|
||||
top: -20px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: 0;
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
.essay-description {
|
||||
width: 100%;
|
||||
line-height: 1.4rem;
|
||||
word-break: break-word;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
.pagination-item {
|
||||
margin: auto 0 auto 0;
|
||||
}
|
||||
|
||||
.chevron-left {
|
||||
font-size: 1.2rem;
|
||||
font-family: "Font Awesome 6 Free", sans-serif;
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.chevron-left::before {
|
||||
content: "\f053";
|
||||
}
|
||||
|
||||
.chevron-right {
|
||||
font-size: 1.2rem;
|
||||
font-family: "Font Awesome 6 Free", sans-serif;
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.chevron-right::before {
|
||||
content: "\f054";
|
||||
}
|
58
YaeBlog/Pages/Links.razor
Normal file
58
YaeBlog/Pages/Links.razor
Normal file
@@ -0,0 +1,58 @@
|
||||
@page "/links"
|
||||
@using YaeBlog.Core.Models
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
|
||||
<PageTitle>
|
||||
友链
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="link-background" style="background-image: url('@(BlogOptionsInstance.EssayImage)')">
|
||||
<div class="link-content">
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<FluentLabel Typo="@Typography.H2" Style="color: white">
|
||||
友 情 链 接
|
||||
</FluentLabel>
|
||||
|
||||
<div style="height: 5rem"></div>
|
||||
|
||||
<FluentCard Style="padding: 3rem;">
|
||||
<FluentGrid>
|
||||
@foreach (FriendLink link in BlogOptionsInstance.Links)
|
||||
{
|
||||
<FluentGridItem xs="12" sm="6" md="4" lg="3">
|
||||
<a href="@(link.Link)" target="_blank">
|
||||
<div class="link-item">
|
||||
<div class="link-item-image">
|
||||
<img src="@(link.AvatarImage)" alt="@(link.Name)">
|
||||
</div>
|
||||
|
||||
<div style="margin: 0.5rem">
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
@(link.Name)
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.Body" Style="color: #718096">
|
||||
@(link.Description)
|
||||
</FluentLabel>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</FluentGridItem>
|
||||
}
|
||||
</FluentGrid>
|
||||
</FluentCard>
|
||||
</FluentStack>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
37
YaeBlog/Pages/Links.razor.css
Normal file
37
YaeBlog/Pages/Links.razor.css
Normal file
@@ -0,0 +1,37 @@
|
||||
.link-background {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.link-content {
|
||||
top: 23%;
|
||||
position: absolute;
|
||||
width: 80%;
|
||||
margin: 0 10%;
|
||||
}
|
||||
|
||||
.link-item {
|
||||
display: flex;
|
||||
padding: 1rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.link-item:hover {
|
||||
background-color: rgba(172, 172, 172, 0.25);
|
||||
}
|
||||
|
||||
.link-item-image {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
}
|
||||
|
||||
.link-item-image img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
17
YaeBlog/Pages/NotFound.razor
Normal file
17
YaeBlog/Pages/NotFound.razor
Normal file
@@ -0,0 +1,17 @@
|
||||
@page "/NotFound"
|
||||
|
||||
<div style="height: 100%">
|
||||
<div style="height: 2rem"></div>
|
||||
|
||||
<div style="margin: 0 8%">
|
||||
<FluentCard>
|
||||
<FluentLabel Typo="@Typography.H4">
|
||||
前面的区域,以后再来探索吧,,
|
||||
</FluentLabel>
|
||||
</FluentCard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
|
||||
}
|
96
YaeBlog/Pages/Tags.razor
Normal file
96
YaeBlog/Pages/Tags.razor
Normal file
@@ -0,0 +1,96 @@
|
||||
@page "/tags"
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContentInstance
|
||||
|
||||
<PageTitle>
|
||||
标签
|
||||
</PageTitle>
|
||||
|
||||
<div style="height: 100%">
|
||||
<div class="tag-background" style="background-image: url('@(BlogOptionsInstance.EssayImage)')">
|
||||
<div class="tag-title">
|
||||
<FluentStack Orientation="@Orientation.Vertical"
|
||||
HorizontalAlignment="@HorizontalAlignment.Center">
|
||||
<FluentLabel Typo="@Typography.H1" Color="@Color.Fill">
|
||||
@(TagName ?? "标 签")
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 2rem"></div>
|
||||
|
||||
<div style="margin: 0 8% 0 8%">
|
||||
<FluentCard>
|
||||
<div style="margin: 0 8%">
|
||||
@if (TagName is null)
|
||||
{
|
||||
<FluentStack Orientation="@Orientation.Horizontal"
|
||||
Wrap="true" Style="margin: 2rem 0">
|
||||
@foreach (KeyValuePair<string, int> pair in EssayContentInstance.Tags)
|
||||
{
|
||||
<div class="tag-item">
|
||||
<a href="tags?TagName=@(pair.Key)">
|
||||
<span style="font-size: @(14 + pair.Value)px; color: @(RandomColor())">
|
||||
@pair.Key
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
</FluentStack>
|
||||
}
|
||||
else
|
||||
{
|
||||
<FluentLabel Typo="@Typography.H2" Style="margin: 3rem 0 2rem 0; color: #404853">
|
||||
共计@(EssayContentInstance.GetTag(TagName).Count())篇文章
|
||||
</FluentLabel>
|
||||
|
||||
@foreach (BlogEssay essay in EssayContentInstance.GetTag(TagName))
|
||||
{
|
||||
<div style="margin: 0 4% 0 4%">
|
||||
<div class="tag-essay-item">
|
||||
<a href="essays/@(essay.FileName)" target="_blank">
|
||||
<FluentStack Orientation="@Orientation.Horizontal">
|
||||
<FluentLabel Typo="@Typography.H5" Style="width: 120px">
|
||||
@(essay.PublishTime.ToString("yyyy-MM-dd"))
|
||||
</FluentLabel>
|
||||
|
||||
<FluentLabel Typo="@Typography.H5">
|
||||
@(essay.Title)
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</FluentCard>
|
||||
</div>
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromQuery]
|
||||
private string? TagName { get; set; }
|
||||
|
||||
private static string[] s_colors =
|
||||
[
|
||||
"#337ab7",
|
||||
"#bbe",
|
||||
"#4e87c2",
|
||||
"#a0aee3",
|
||||
"#6994cd",
|
||||
"#85a1d8"
|
||||
];
|
||||
|
||||
private static string RandomColor()
|
||||
{
|
||||
return Random.Shared.GetItems(s_colors, 1)[0];
|
||||
}
|
||||
|
||||
}
|
27
YaeBlog/Pages/Tags.razor.css
Normal file
27
YaeBlog/Pages/Tags.razor.css
Normal file
@@ -0,0 +1,27 @@
|
||||
.tag-background {
|
||||
position: relative;
|
||||
height: 60%;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.tag-title {
|
||||
top: 43%;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tag-item {
|
||||
margin: 0.25rem auto;
|
||||
}
|
||||
|
||||
.tag-essay-item {
|
||||
padding: 0.5rem 0.5rem 0.5rem 0.5rem;
|
||||
margin: 0.5rem 0 0.5rem 0;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tag-essay-item:hover {
|
||||
background-color: rgba(169, 169, 169, 0.22);
|
||||
}
|
21
YaeBlog/Program.cs
Normal file
21
YaeBlog/Program.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using YaeBlog.Components;
|
||||
using YaeBlog.Core.Extensions;
|
||||
|
||||
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
builder.Services.AddControllers();
|
||||
builder.AddYaeBlog();
|
||||
|
||||
WebApplication application = builder.Build();
|
||||
|
||||
application.UseStaticFiles();
|
||||
application.UseAntiforgery();
|
||||
application.UseMiddleRenderProcessors();
|
||||
|
||||
application.MapRazorComponents<App>()
|
||||
.AddInteractiveServerRenderMode();
|
||||
application.MapControllers();
|
||||
|
||||
await application.RunAsync();
|
22
YaeBlog/Properties/launchSettings.json
Normal file
22
YaeBlog/Properties/launchSettings.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:14405",
|
||||
"sslPort": 44378
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:5275",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
37
YaeBlog/YaeBlog.csproj
Normal file
37
YaeBlog/YaeBlog.csproj
Normal file
@@ -0,0 +1,37 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\YaeBlog.Core\YaeBlog.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="Layout\MainLayout.razor" />
|
||||
<AdditionalFiles Include="Pages\About.razor" />
|
||||
<AdditionalFiles Include="Pages\Archives.razor" />
|
||||
<AdditionalFiles Include="Pages\Error.razor" />
|
||||
<AdditionalFiles Include="Pages\Essay.razor" />
|
||||
<AdditionalFiles Include="Pages\Home.razor" />
|
||||
<AdditionalFiles Include="Pages\Links.razor" />
|
||||
<AdditionalFiles Include="Pages\NotFound.razor" />
|
||||
<AdditionalFiles Include="Pages\Tags.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\About.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Archives.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Error.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Essay.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Home.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Links.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\NotFound.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Pages\Tags.razor" />
|
||||
<_ContentIncludedByDefault Remove="Components\Layout\MainLayout.razor" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
11
YaeBlog/_Imports.razor
Normal file
11
YaeBlog/_Imports.razor
Normal file
@@ -0,0 +1,11 @@
|
||||
@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
|
||||
@using Microsoft.FluentUI.AspNetCore.Components
|
||||
@using YaeBlog
|
||||
@using YaeBlog.Components
|
44
YaeBlog/appsettings.json
Normal file
44
YaeBlog/appsettings.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Blog": {
|
||||
"Root": "source",
|
||||
"Author": "Ricardo Ren",
|
||||
"Announcement": "堂!堂!开!始!",
|
||||
"StartYear": 2021,
|
||||
"ProjectName": "Blog",
|
||||
"BannerImage": "images/banner.png",
|
||||
"EssayImage": "images/banner.png",
|
||||
"RegisterInformation": "蜀ICP备2022004429号-1",
|
||||
"About": {
|
||||
"Introduction": "A CS Student",
|
||||
"Description": "还太菜了,没有做出太多的贡献。",
|
||||
"AvatarImage": "images/avatar.png"
|
||||
},
|
||||
"Links": [
|
||||
{
|
||||
"Name": "Ichirinko",
|
||||
"Description": "这是个大哥",
|
||||
"Link": "https://ichirinko.top",
|
||||
"AvatarImage": "https://ichirinko-blog-img-1.oss-cn-shenzhen.aliyuncs.com/Pic_res/img/202209122110798.png"
|
||||
},
|
||||
{
|
||||
"Name": "志田千陽",
|
||||
"Description": "日出多期待",
|
||||
"Link": "https://zzachary.top/",
|
||||
"AvatarImage": "https://zzachary.top/img/ztqy_hub928259802d192ff5718c06370f0f2c4_48203_300x0_resize_q75_box.jpg"
|
||||
},
|
||||
{
|
||||
"Name": "Chenxu",
|
||||
"Description": "一个普通大学生",
|
||||
"Link": "https://chenxutalk.top",
|
||||
"AvatarImage": "https://www.chenxutalk.top/img/photo.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
2
YaeBlog/wwwroot/fonts/.gitattributes
vendored
Normal file
2
YaeBlog/wwwroot/fonts/.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.woff2 filter=lfs diff=lfs merge=lfs -text
|
BIN
YaeBlog/wwwroot/fonts/fa-regular-400.ttf
(Stored with Git LFS)
Normal file
BIN
YaeBlog/wwwroot/fonts/fa-regular-400.ttf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
YaeBlog/wwwroot/fonts/fa-regular-400.woff2
(Stored with Git LFS)
Normal file
BIN
YaeBlog/wwwroot/fonts/fa-regular-400.woff2
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
YaeBlog/wwwroot/fonts/fa-solid-900.ttf
(Stored with Git LFS)
Normal file
BIN
YaeBlog/wwwroot/fonts/fa-solid-900.ttf
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
YaeBlog/wwwroot/fonts/fa-solid-900.woff2
(Stored with Git LFS)
Normal file
BIN
YaeBlog/wwwroot/fonts/fa-solid-900.woff2
(Stored with Git LFS)
Normal file
Binary file not shown.
56
YaeBlog/wwwroot/globals.css
Normal file
56
YaeBlog/wwwroot/globals.css
Normal file
@@ -0,0 +1,56 @@
|
||||
body a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background-color: #80c8f8;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: #80c8f8 transparent;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Font Awesome 6 Free";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: block;
|
||||
src: url(fonts/fa-regular-400.woff2) format("woff2"),url(fonts/fa-regular-400.ttf) format("truetype")
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "Font Awesome 6 Free";
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
font-display: block;
|
||||
src: url(fonts/fa-solid-900.woff2) format("woff2"),url(fonts/fa-solid-900.ttf) format("truetype")
|
||||
}
|
||||
|
||||
.essay-image {
|
||||
width: 90%;
|
||||
display: block;
|
||||
margin: 1.5rem auto;
|
||||
box-shadow: 0 5px 11px 0 rgba(0,0,0,0.18),
|
||||
0 4px 15px 0 rgba(0,0,0,0.15);
|
||||
border-radius: 4px;
|
||||
background-color: transparent;
|
||||
}
|
BIN
YaeBlog/wwwroot/images/avatar.png
Normal file
BIN
YaeBlog/wwwroot/images/avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 440 KiB |
BIN
YaeBlog/wwwroot/images/banner.png
Normal file
BIN
YaeBlog/wwwroot/images/banner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 MiB |
BIN
YaeBlog/wwwroot/images/favicon.ico
Normal file
BIN
YaeBlog/wwwroot/images/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Reference in New Issue
Block a user