before push commit
This commit is contained in:
parent
bd920f1731
commit
5217bba8f9
15 changed files with 125 additions and 59 deletions
|
@ -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()}`;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue