feat: 根据htmlType设置页面title
This commit is contained in:
parent
aad3b5c8b0
commit
51cad0e4c7
|
@ -28,6 +28,37 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 根据htmlType设置页面title
|
||||||
|
let setTitle = ()=>{
|
||||||
|
let title = ''
|
||||||
|
|
||||||
|
switch([[${htmlType}]]){
|
||||||
|
case 'post':
|
||||||
|
if(GLOBAL_CONFIG.postTitle != '')
|
||||||
|
title = GLOBAL_CONFIG.postTitle
|
||||||
|
break;
|
||||||
|
case 'archive':
|
||||||
|
title = '归档'
|
||||||
|
break;
|
||||||
|
case 'category':
|
||||||
|
title = '分类'
|
||||||
|
break;
|
||||||
|
case 'links':
|
||||||
|
title = '友链'
|
||||||
|
break;
|
||||||
|
case 'tag':
|
||||||
|
title = '标签'
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(title != '')
|
||||||
|
document.title = title + ' - ' + [[${site.title}]]
|
||||||
|
}
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
setTitle()
|
||||||
|
})()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in New Issue