Init: First Commit

一个初始的版本
This commit is contained in:
2023-11-23 00:05:07 +08:00
commit 9391a37b21
30 changed files with 8021 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// 站点名称
export const siteTitle = (title?: string) => {
const siteName = import.meta.env.APP_SITENAME;
return title ? `${title} - ${siteName}` : siteName;
}
// Classnames
export const clsn = (...clsn: (string | undefined | null | false)[]) => {
return clsn.filter(item => item).join(" ");
}
+11
View File
@@ -0,0 +1,11 @@
// 获取第一张图片
export const getFirstImage = (note: API.Note.INoteData) => {
if (note.media && note.media.length > 0) {
return note.media[0].url;
}
// 遗留版本
if (note.photo && note.photo.length > 0) {
return note.photo[0].url;
}
}