You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcity=author.city ? ` based in ${author.city}` : "";
57
+
return`${author.name} is a ${role} on the ${SITE_NAME} team${city}.`;
58
+
}
59
+
60
+
functionbuildAuthorBody(author: AuthorData){
61
+
constcity=author.city ? ` Based in ${author.city},` : "";
62
+
return`${city}${author.name} contributes to ${SITE_NAME} by supporting tutorials, documentation, and the broader learning experience for the community.`.trim();
63
+
}
64
+
65
+
asyncfunctiongetLatestPublishedArticles(count=4){
66
+
constlatestSnapshot=awaitgetDocs(
67
+
query(
68
+
collection(db,"articles"),
69
+
where("publish","==",true),
70
+
orderBy("date","desc"),
71
+
limit(count),
72
+
),
73
+
);
74
+
75
+
returnlatestSnapshot.docs.map((doc)=>{
76
+
constdata=doc.data();
77
+
return{
78
+
uid: doc.id,
79
+
title: data.title||"Untitled",
80
+
img: data.img||"/default-image.png",
81
+
date: data.date?.toDate?.()||newDate(),
82
+
read: data.read||"Unknown",
83
+
label: data.label||"No Label",
84
+
slug: data.slug||"",
85
+
authorUID: data.authorUID||"",
86
+
publish: data.publish??false,
87
+
}asArticleData;
88
+
});
89
+
}
90
+
53
91
// Function to fetch author data
54
92
asyncfunctiongetAuthorData(slug: string){
55
93
try{
@@ -60,7 +98,12 @@ async function getAuthorData(slug: string) {
0 commit comments