before push commit

This commit is contained in:
Laker Turner 2025-03-24 18:13:50 +00:00
parent bd920f1731
commit 5217bba8f9
No known key found for this signature in database
15 changed files with 125 additions and 59 deletions

View file

@ -1,18 +1,25 @@
import conf from "~/site.config";
// todo: add blog detection
export const titleConstructor = (title: string) => {
console.log(title)
if (!title) return conf.siteName;
return `${title} | ${conf.siteName}`;
export const isBlog = (pathname: string) => {
return pathname.startsWith("/blog");
};
export const titleConstructor = (title: string, pathname: string) => {
if (isBlog(pathname)) {
return title
? `${title} | Everything And The Girl`
: "Everything And The Girl";
}
if (!title) return conf.siteName;
return `${title} | ${conf.siteName}`;
};
export const descriptionConstructor = (description: string) => {
if (!description) return conf.description;
return `${description}`;
if (!description) return conf.description;
return `${description}`;
};
export const noteTitleConstructor = (title: string, date: Date) => {
if (title) return title;
return `A note from ${date.toLocaleDateString()}`;
};
if (title) return title;
return `A note from ${date.toLocaleDateString()}`;
};