Merge pull request #77 from shy-share/devv

文章顶部导航栏显示文章标题
This commit is contained in:
sunheyi 2023-02-08 11:19:51 +08:00 committed by GitHub
commit b65935b100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 () {