Fix: Note List Page Styles
样式调整,显示站点名称,获取日记首图,列表页参数获取
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
// 站点名称
|
||||
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(" ");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user