forked from nacos-group/nacos-group.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop-astro-nacos' into deve…
…lop-astro-nacos
- Loading branch information
Showing
24 changed files
with
471 additions
and
999 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"login":"nkorange","avatar_url":"https://avatars.githubusercontent.com/u/4593375?v=4","html_url":"https://github.com/nkorange"},{"login":"KomachiSion","avatar_url":"https://avatars.githubusercontent.com/u/37170243?v=4","html_url":"https://github.com/KomachiSion"},{"login":"chuntaojun","avatar_url":"https://avatars.githubusercontent.com/u/23445172?v=4","html_url":"https://github.com/chuntaojun"},{"login":"loadchange","avatar_url":"https://avatars.githubusercontent.com/u/10842824?v=4","html_url":"https://github.com/loadchange"},{"login":"yanlinly","avatar_url":"https://avatars.githubusercontent.com/u/17695352?v=4","html_url":"https://github.com/yanlinly"},{"login":"xuechaos","avatar_url":"https://avatars.githubusercontent.com/u/3983999?v=4","html_url":"https://github.com/xuechaos"},{"login":"jameslcj","avatar_url":"https://avatars.githubusercontent.com/u/11494059?v=4","html_url":"https://github.com/jameslcj"},{"login":"li-xiao-shuang","avatar_url":"https://avatars.githubusercontent.com/u/34903552?v=4","html_url":"https://github.com/li-xiao-shuang"},{"login":"KeRan213539","avatar_url":"https://avatars.githubusercontent.com/u/1195743?v=4","html_url":"https://github.com/KeRan213539"},{"login":"hxy1991","avatar_url":"https://avatars.githubusercontent.com/u/2517258?v=4","html_url":"https://github.com/hxy1991"},{"login":"shiyiyue1102","avatar_url":"https://avatars.githubusercontent.com/u/20452676?v=4","html_url":"https://github.com/shiyiyue1102"},{"login":"brotherlu-xcq","avatar_url":"https://avatars.githubusercontent.com/u/25661357?v=4","html_url":"https://github.com/brotherlu-xcq"},{"login":"horizonzy","avatar_url":"https://avatars.githubusercontent.com/u/22524871?v=4","html_url":"https://github.com/horizonzy"},{"login":"Daydreamer-ia","avatar_url":"https://avatars.githubusercontent.com/u/83362909?v=4","html_url":"https://github.com/Daydreamer-ia"},{"login":"Maijh97","avatar_url":"https://avatars.githubusercontent.com/u/37288946?v=4","html_url":"https://github.com/Maijh97"},{"login":"onewe","avatar_url":"https://avatars.githubusercontent.com/u/38708836?v=4","html_url":"https://github.com/onewe"},{"login":"hujun-w-2","avatar_url":"https://avatars.githubusercontent.com/u/39894911?v=4","html_url":"https://github.com/hujun-w-2"},{"login":"MajorHe1","avatar_url":"https://avatars.githubusercontent.com/u/53824889?v=4","html_url":"https://github.com/MajorHe1"},{"login":"pbting","avatar_url":"https://avatars.githubusercontent.com/u/11469671?v=4","html_url":"https://github.com/pbting"},{"login":"zhaoyuguang","avatar_url":"https://avatars.githubusercontent.com/u/10150229?v=4","html_url":"https://github.com/zhaoyuguang"},{"login":"zongtanghu","avatar_url":"https://avatars.githubusercontent.com/u/5010883?v=4","html_url":"https://github.com/zongtanghu"},{"login":"IanCao","avatar_url":"https://avatars.githubusercontent.com/u/32847163?v=4","html_url":"https://github.com/IanCao"},{"login":"mercyblitz","avatar_url":"https://avatars.githubusercontent.com/u/533114?v=4","html_url":"https://github.com/mercyblitz"},{"login":"ZZQ001010","avatar_url":"https://avatars.githubusercontent.com/u/33930711?v=4","html_url":"https://github.com/ZZQ001010"}] | ||
[{"login":"nkorange","avatar_url":"https://avatars.githubusercontent.com/u/4593375?v=4","html_url":"https://github.com/nkorange"},{"login":"KomachiSion","avatar_url":"https://avatars.githubusercontent.com/u/37170243?v=4","html_url":"https://github.com/KomachiSion"},{"login":"chuntaojun","avatar_url":"https://avatars.githubusercontent.com/u/23445172?v=4","html_url":"https://github.com/chuntaojun"},{"login":"loadchange","avatar_url":"https://avatars.githubusercontent.com/u/10842824?v=4","html_url":"https://github.com/loadchange"},{"login":"yanlinly","avatar_url":"https://avatars.githubusercontent.com/u/17695352?v=4","html_url":"https://github.com/yanlinly"},{"login":"xuechaos","avatar_url":"https://avatars.githubusercontent.com/u/3983999?v=4","html_url":"https://github.com/xuechaos"},{"login":"jameslcj","avatar_url":"https://avatars.githubusercontent.com/u/11494059?v=4","html_url":"https://github.com/jameslcj"},{"login":"li-xiao-shuang","avatar_url":"https://avatars.githubusercontent.com/u/34903552?v=4","html_url":"https://github.com/li-xiao-shuang"},{"login":"KeRan213539","avatar_url":"https://avatars.githubusercontent.com/u/1195743?v=4","html_url":"https://github.com/KeRan213539"},{"login":"hxy1991","avatar_url":"https://avatars.githubusercontent.com/u/2517258?v=4","html_url":"https://github.com/hxy1991"},{"login":"shiyiyue1102","avatar_url":"https://avatars.githubusercontent.com/u/20452676?v=4","html_url":"https://github.com/shiyiyue1102"},{"login":"brotherlu-xcq","avatar_url":"https://avatars.githubusercontent.com/u/25661357?v=4","html_url":"https://github.com/brotherlu-xcq"},{"login":"horizonzy","avatar_url":"https://avatars.githubusercontent.com/u/22524871?v=4","html_url":"https://github.com/horizonzy"},{"login":"Daydreamer-ia","avatar_url":"https://avatars.githubusercontent.com/u/83362909?v=4","html_url":"https://github.com/Daydreamer-ia"},{"login":"Maijh97","avatar_url":"https://avatars.githubusercontent.com/u/37288946?v=4","html_url":"https://github.com/Maijh97"},{"login":"onewe","avatar_url":"https://avatars.githubusercontent.com/u/38708836?v=4","html_url":"https://github.com/onewe"},{"login":"hujun-w-2","avatar_url":"https://avatars.githubusercontent.com/u/39894911?v=4","html_url":"https://github.com/hujun-w-2"},{"login":"MajorHe1","avatar_url":"https://avatars.githubusercontent.com/u/53824889?v=4","html_url":"https://github.com/MajorHe1"},{"login":"pbting","avatar_url":"https://avatars.githubusercontent.com/u/11469671?v=4","html_url":"https://github.com/pbting"},{"login":"zhaoyuguang","avatar_url":"https://avatars.githubusercontent.com/u/10150229?v=4","html_url":"https://github.com/zhaoyuguang"},{"login":"zongtanghu","avatar_url":"https://avatars.githubusercontent.com/u/5010883?v=4","html_url":"https://github.com/zongtanghu"},{"login":"mercyblitz","avatar_url":"https://avatars.githubusercontent.com/u/533114?v=4","html_url":"https://github.com/mercyblitz"},{"login":"IanCao","avatar_url":"https://avatars.githubusercontent.com/u/32847163?v=4","html_url":"https://github.com/IanCao"},{"login":"ZZQ001010","avatar_url":"https://avatars.githubusercontent.com/u/33930711?v=4","html_url":"https://github.com/ZZQ001010"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
import Button from '@components/common/Button.astro'; | ||
import moment from "moment"; | ||
import { useTranslations } from "@i18n/util"; | ||
const t = useTranslations(Astro); | ||
export type Props = { | ||
source: string; | ||
post: { | ||
slug: string; | ||
body: string; | ||
collection: string; | ||
excerpt?: string; | ||
data: { | ||
title: string; | ||
description: string; | ||
date: string; | ||
keywords?: any[]; | ||
}; | ||
}; | ||
posterWidth?: string; | ||
type?: string; | ||
index?: number; | ||
useAnchor?: boolean; | ||
}; | ||
const { post, source, posterWidth, type = "blog",index = 0, class: className = "", useAnchor=false, } = Astro.props; | ||
--- | ||
|
||
<div class={"card h-[332px] p-[24px] bg-gray-01 shadow-none w-full flex" + className}> | ||
<!-- 锚点 --> | ||
{useAnchor?<a name={post.slug} class={"absolute z-[-100] top-[-4rem]"}></a>:null} | ||
|
||
<p class="text-gray-07 text-xs font-normal"> | ||
{moment(post.data.date).format("MMMM D, YYYY")} | ||
</p> | ||
<h2 class="card-title text-gray-14 leading-8 line-clamp-2 mb-3 font-normal text-xl mt-3 truncate"> | ||
{post.data.title} | ||
</h2> | ||
|
||
<div class="w-full text-lg text-gart-14 leading-8 overflow-hidden"> | ||
{post.excerpt || post.data.description} | ||
</div> | ||
|
||
<Button | ||
size="large" | ||
type="card" | ||
href={`/blog/${post.slug}/?source=${source}`} | ||
class="rounded-3xl text-xs absolute bottom-3 bg-gray-02" | ||
> | ||
{t('blog.card.read.artile')} | ||
</Button> | ||
</div> | ||
|
||
<style> | ||
.card { | ||
transition: | ||
transform 0.2s, | ||
box-shadow 0.2s; | ||
} | ||
.card:hover { | ||
transition: | ||
transform 0.2s, | ||
box-shadow 0.2s; | ||
transform: translateY(-4px); | ||
box-shadow: | ||
4px 4px 8px rgba(0, 0, 0, 0.1), | ||
-4px -4px 8px rgba(0, 0, 0, 0.1); | ||
} | ||
a { | ||
text-decoration: none; | ||
color: inherit; | ||
} | ||
h2 { | ||
min-height: 3rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
--- | ||
import BaseContainer from '@components/common/BaseContainer.astro'; | ||
import Pagination from "@components/common/Pagination.astro"; | ||
import SimpleCard from "@components/markdownSet/SimpleCard.astro"; | ||
interface Post { | ||
slug: string; | ||
body: string; | ||
collection: string; | ||
data: { | ||
title: string; | ||
description: string; | ||
date: string; | ||
keywords?: any[]; | ||
}; | ||
}; | ||
interface Props { | ||
pageList: Post[]; | ||
allPages?: string[]; | ||
} | ||
const { pageList, allPages } = Astro.props; | ||
// Get word for mdx | ||
const getExcerpt = (content, length = 200, defaultExcerpt = '') => { | ||
try { | ||
const strippedContent = content.replace(/(<([^>]+)>)/gi, ''); | ||
const plainText = strippedContent.replace(/[#>*-]|\[.*?\]\(.*?\)|\!\[.*?\]\(.*?\)/g, ''); | ||
let excerpt = plainText.substring(0, length); | ||
if (plainText.length > length) { | ||
excerpt += '...'; | ||
}; | ||
return excerpt; | ||
} catch(error) { | ||
return defaultExcerpt; | ||
}; | ||
}; | ||
if(pageList && pageList.length) { | ||
pageList.forEach(item => { | ||
item.excerpt = getExcerpt(item.body, 120, item.data?.description); | ||
}); | ||
}; | ||
--- | ||
|
||
<BaseContainer class="flex justify-between"> | ||
<div class="max-w-[200px] min-w-[200px] hidden 2xl:block xl:block lg:block"> | ||
<div class="text-lg text-gray-08 mb-[32px]">文章</div> | ||
<div class="text-lg text-gray-14"> | ||
{ | ||
pageList.map(post=>{ | ||
return ( | ||
<a | ||
class="text-gray-14 no-underline font-normal block mb-[24px]" | ||
href={`#${post.slug}`} | ||
> | ||
{ post.data.title } | ||
</a> | ||
); | ||
}) | ||
} | ||
</div> | ||
</div> | ||
|
||
<ul class="flex-1 blog-all grid grid-cols-1 gap-6 place-items-stretch 2xl:ml-[100px] xl:ml-[80px] lg:ml-[50px] md:ml-[0px]"> | ||
{ | ||
pageList.map((post) => ( | ||
<SimpleCard | ||
post={post as Post} | ||
source="blog_all" | ||
useAnchor={true} | ||
/> | ||
)) | ||
} | ||
</ul> | ||
</BaseContainer> | ||
|
||
<style> | ||
main { | ||
width: 960px; | ||
} | ||
ul { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: 2rem; | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
ul li { | ||
width: calc(50% - 1rem); | ||
} | ||
ul li * { | ||
text-decoration: none; | ||
transition: 0.2s ease; | ||
} | ||
ul li:first-child { | ||
width: 100%; | ||
margin-bottom: 1rem; | ||
text-align: center; | ||
} | ||
ul li:first-child img { | ||
width: 100%; | ||
} | ||
ul li:first-child .title { | ||
font-size: 2.369rem; | ||
} | ||
ul li img { | ||
margin-bottom: 0.5rem; | ||
border-radius: 12px; | ||
} | ||
ul li a { | ||
display: block; | ||
} | ||
.title { | ||
margin: 0; | ||
color: rgb(var(--black)); | ||
line-height: 1; | ||
} | ||
.date { | ||
margin: 0; | ||
color: rgb(var(--gray)); | ||
} | ||
ul li a:hover h4, | ||
ul li a:hover .date { | ||
color: rgb(var(--accent)); | ||
} | ||
ul a:hover img { | ||
box-shadow: var(--box-shadow); | ||
} | ||
@media (max-width: 50rem) { | ||
.blog-all { | ||
padding: 0 1.5rem; | ||
} | ||
ul { | ||
gap: 0.5em; | ||
} | ||
ul li { | ||
width: 100%; | ||
text-align: center; | ||
} | ||
ul li:first-child { | ||
margin-bottom: 0; | ||
} | ||
ul li:first-child .title { | ||
font-size: 1.563em; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.