文章顶部导航栏显示文章标题

This commit is contained in:
sunheyi 2023-02-08 11:16:32 +08:00
parent 35a41d33bb
commit 990272cd19
1 changed files with 2 additions and 2 deletions

View File

@ -165,8 +165,8 @@ function getContrastYIQ(hexcolor) {
//导航栏文章
function navTitle() {
var titlevalue = document.title;
var simptitle = titlevalue.replace(' | XXXX', '')
document.getElementById("page-name-text").innerHTML = simptitle;
var postName = document.getElementsByClassName("post-title")[0];
document.getElementById("page-name-text").innerHTML = postName.innerText;
}
window.onload = function () {