feat: 使用Bootstrap重写前端页面 (#2)
All checks were successful
Build blog docker image / Build-Blog-Image (push) Successful in 1m15s
All checks were successful
Build blog docker image / Build-Blog-Image (push) Successful in 1m15s
Reviewed-on: #2
This commit is contained in:
@@ -2,64 +2,59 @@
|
||||
@using YaeBlog.Core.Models
|
||||
@using YaeBlog.Core.Services
|
||||
|
||||
@inject BlogOptions BlogOptionsInstance
|
||||
@inject EssayContentService EssayContentInstance
|
||||
|
||||
<PageTitle>
|
||||
存档
|
||||
</PageTitle>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1>归档</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 class="row">
|
||||
<div class="col fst-italic py-4">
|
||||
时光图书馆,黑历史集散地。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="height: 2rem"></div>
|
||||
@foreach (IGrouping<DateTime, KeyValuePair<string, BlogEssay>> group in _essays)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h3>@(group.Key.Year)</h3>
|
||||
</div>
|
||||
</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="container px-3 py-2">
|
||||
@foreach (KeyValuePair<string, BlogEssay> essay in group)
|
||||
{
|
||||
<div class="archive-item">
|
||||
<a href="/blog/essays/@(pair.Key)" target="_blank">
|
||||
<FluentStack Orientation="@Orientation.Horizontal">
|
||||
<FluentLabel Typo="@Typography.H5" Style="width: 80px">
|
||||
@(pair.Value.PublishTime.ToString("MM-dd"))
|
||||
</FluentLabel>
|
||||
<div class="row py-1">
|
||||
<div class="col-auto">
|
||||
@(essay.Value.PublishTime.ToString("MM-dd"))
|
||||
</div>
|
||||
|
||||
<FluentLabel Typo="@Typography.H5">
|
||||
@(pair.Value.Title)
|
||||
</FluentLabel>
|
||||
</FluentStack>
|
||||
</a>
|
||||
<div class="col-auto">
|
||||
<a href="/blog/@(essay.Key)">
|
||||
@(essay.Value.Title)
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</FluentCard>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<BlogFooter/>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@@ -67,12 +62,11 @@
|
||||
|
||||
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);
|
||||
base.OnInitialized();
|
||||
|
||||
_essays.AddRange(essays);
|
||||
_essays.AddRange(from essay in EssayContentInstance.Essays
|
||||
orderby essay.Value.PublishTime descending
|
||||
group essay by new DateTime(essay.Value.PublishTime.Year, 1, 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user