mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-03 14:38:49 +00:00
use page category for title
This commit is contained in:
1 parent
3bc548fce4
commit
b5443f9b52
1 file changed
+4
-3
+4
-3
@@ -24,11 +24,12 @@ function useHead() {
|
|||||||
|
|
||||||
function useNextSeoProps() {
|
function useNextSeoProps() {
|
||||||
const { asPath } = useRouter();
|
const { asPath } = useRouter();
|
||||||
const arr = asPath.split('/');
|
const arr = asPath.replace(/[-_]/g, ' ').split('/');
|
||||||
const title = arr[arr.length - 1].replace(/[-_]/g, ' ');
|
const category = arr[1].replace(/(^\w|\s\w)/g, m => m.toUpperCase()) || 'Overextended'
|
||||||
|
const title = arr[arr.length - 1]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
titleTemplate: `${/[a-z]/.test(title) && /[A-Z]/.test(title) ? title : '%s'} - Overextended`,
|
titleTemplate: `${/[a-z]/.test(title) && /[A-Z]/.test(title) ? title : '%s'} - ${category}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user