mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-02 22:22:46 +00:00
change index title
This commit is contained in:
1 parent
446ae4e312
commit
f0b6160b93
1 file changed
+6
-4
+6
-4
@@ -25,12 +25,14 @@ function useHead() {
|
|||||||
function useNextSeoProps() {
|
function useNextSeoProps() {
|
||||||
const { asPath } = useRouter();
|
const { asPath } = useRouter();
|
||||||
const arr = asPath.replace(/[-_]/g, ' ').split('/');
|
const arr = asPath.replace(/[-_]/g, ' ').split('/');
|
||||||
const category = arr[1][0] !== '#' && arr[1]
|
const category = (arr[1][0] !== '#' && arr[1]) || 'Overextended';
|
||||||
const rawTitle = arr[arr.length - 1]
|
const rawTitle = arr[arr.length - 1];
|
||||||
const title = /[a-z]/.test(rawTitle) && /[A-Z]/.test(rawTitle) ? rawTitle : '%s'
|
const title = /[a-z]/.test(rawTitle) && /[A-Z]/.test(rawTitle) ? rawTitle : '%s';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
titleTemplate: `${title} - ${rawTitle === category ? 'Overextended' : category.replace(/(^\w|\s\w)/g, m => m.toUpperCase())}`,
|
titleTemplate: `${title} - ${
|
||||||
|
rawTitle === category ? 'Documentation' : category.replace(/(^\w|\s\w)/g, (m) => m.toUpperCase())
|
||||||
|
}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user