add: Friend link

This commit is contained in:
jackfiled 2024-07-29 22:31:40 +08:00
parent 2e0de81517
commit eef0943900
5 changed files with 110 additions and 76 deletions

View File

@ -10,10 +10,8 @@ public class BlogOptions
public required string Root { get; set; } public required string Root { get; set; }
/// <summary> /// <summary>
/// 博客作者 /// 博客正文的广而告之
/// </summary> /// </summary>
public required string Author { get; set; }
public required string Announcement { get; set; } public required string Announcement { get; set; }
/// <summary> /// <summary>
@ -22,21 +20,7 @@ public class BlogOptions
public required int StartYear { get; set; } public required int StartYear { get; set; }
/// <summary> /// <summary>
/// 博客起始页面的背景图片 /// 博客的友链
/// </summary> /// </summary>
public required string BannerImage { get; set; }
/// <summary>
/// 文章页面的背景图片
/// </summary>
public required string EssayImage { get; set; }
/// <summary>
/// 博客底部是否显示ICP备案信息
/// </summary>
public string? RegisterInformation { get; set; }
public required AboutInfo About { get; set; }
public required List<FriendLink> Links { get; set; } public required List<FriendLink> Links { get; set; }
} }

View File

@ -6,7 +6,7 @@
<div class="col"> <div class="col">
<div class="row p-1"> <div class="row p-1">
<div class="col"> <div class="col">
文章作者:<a href="https://rrricardo.top" target="_blank">@(Options.Author)</a> 文章作者:<a href="https://rrricardo.top" target="_blank">Ricardo Ren</a>
</div> </div>
</div> </div>

View File

@ -1,4 +1,7 @@
@page "/blog/about" @page "/blog/about"
@using YaeBlog.Core.Models
@inject BlogOptions Options
<PageTitle> <PageTitle>
关于 关于
@ -12,12 +15,13 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col fst-italic py-4"> <div class="col fst-italic py-2">
把字刻在石头上! 把字刻在石头上!(・’ω’・)
</div> </div>
</div> </div>
<div class="row p-2"> <div class="row p-2">
<div class="col">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3>关于我</h3> <h3>关于我</h3>
@ -65,8 +69,10 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row p-2"> <div class="row p-2">
<div class="col">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h3>关于本站</h3> <h3>关于本站</h3>
@ -86,6 +92,52 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row p-2">
<div class="col">
<div class="row">
<div class="col">
<h3>友链</h3>
</div>
</div>
<div class="row py-2">
<div class="col fst-italic">
欢迎所有人联系我添加友链!(´。✪ω✪。`)
</div>
</div>
<div class="row py-2">
@foreach (FriendLink link in Options.Links)
{
<div class="col-sm-12 col-md-4 col-lg-3">
<a href="@(link.Link)" target="_blank" class="m-3">
<div class="row link-item">
<div class="col-4">
<Image Src="@(link.AvatarImage)" Alt="@(link.Name)" Style="border-radius: 50%"/>
</div>
<div class="col-8">
<div class="row">
<div class="col-auto fs-5">
@(link.Name)
</div>
</div>
<div class="row">
<div class="col-auto fst-italic">
@(link.Description)
</div>
</div>
</div>
</div>
</a>
</div>
}
</div>
</div>
</div>
</div> </div>
@code { @code {

View File

@ -0,0 +1,8 @@
.link-item {
padding: 1rem;
border-radius: 4px;
}
.link-item:hover {
background-color: var(--bs-secondary-bg);
}

View File

@ -8,18 +8,8 @@
"AllowedHosts": "*", "AllowedHosts": "*",
"Blog": { "Blog": {
"Root": "source", "Root": "source",
"Author": "Ricardo Ren",
"Announcement": "博客锐意装修中,敬请期待!测试阶段如有问题还请海涵。", "Announcement": "博客锐意装修中,敬请期待!测试阶段如有问题还请海涵。",
"StartYear": 2021, "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": [ "Links": [
{ {
"Name": "Ichirinko", "Name": "Ichirinko",