marked.min升级匹配marked2.1.3版本,meta优化fix

This commit is contained in:
黄心宇 2024-03-18 14:07:40 +08:00
parent 12bf33f8e4
commit 795e8f3c3b
3 changed files with 10 additions and 16 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -345,8 +345,8 @@ export function addMeta(name, content){
*/ */
export function setSeoMeta(keyWords, title, description, url, owner, projectId) { export function setSeoMeta(keyWords, title, description, url, owner, projectId) {
// 服务端没有location // 服务端没有location
const host = window.location.host === 'null' || !window.location.host ? ssrHost : window.location.host const host = window.location.host
const origin = window.location.origin === 'null' || !window.location.origin ? ssrOrigin : window.location.origin const origin = window.location.origin
document.querySelector(`meta[property='og:title']`).content = title + ' | GitLink'; document.querySelector(`meta[property='og:title']`).content = title + ' | GitLink';
document.querySelector(`title`).textContent = title + ' | GitLink'; document.querySelector(`title`).textContent = title + ' | GitLink';
document.querySelector(`meta[property='og:url']`).content = origin + url; document.querySelector(`meta[property='og:url']`).content = origin + url;