refactor: use document.title

This commit is contained in:
Ayo 2023-02-19 10:23:46 +01:00
parent 8d7a99da7f
commit c3efe83de0

View file

@ -41,8 +41,9 @@ const baseURL = "https://ayo.ayco.io";
<link rel="shortcut icon" type="image/png" href="/favicon.ico" />
<script>
const title = document.querySelector("title");
if (title && !title.textContent?.includes("Ayo Ayco"))
title.textContent = title.textContent + " | Ayo Ayco";
const title = document.title;
document.title = title?.includes("Ayo Ayco")
? title
: `${title} | Ayo Ayco`;
</script>
</head>