update setSeoMeta

This commit is contained in:
黄心宇 2024-05-13 11:22:15 +08:00
parent 20c2aef60d
commit 3db703c078
1 changed files with 5 additions and 5 deletions

View File

@ -355,13 +355,13 @@ export function setSeoMeta(keyWords, title, description, url, owner, projectId)
// 服务端没有location
const host = window.location.host === 'null' || !window.location.host ? ssrHost : window.location.host
const origin = window.location.origin === 'null' || !window.location.origin ? ssrOrigin : window.location.origin
document.querySelector(`meta[property='og:title']`).content = title + ' | GitLink';
document.querySelector(`title`).textContent = title + ' | GitLink';
document.querySelector(`meta[property='og:title']`).content = title;
document.querySelector(`title`).textContent = title;
document.querySelector(`meta[property='og:url']`).content = origin + url;
document.querySelector(`meta[property='og:description']`).content = description + ' | GitLink';
document.querySelector(`meta[property='og:image:alt']`).content = description + ' | GitLink';
document.querySelector(`meta[property='og:description']`).content = description;
document.querySelector(`meta[property='og:image:alt']`).content = description;
document.querySelector('meta[name="Keywords"]').content= `${ keyWords }${ keyWords ? '' : 'GitLink, git, 开源, 代码托管, 项目管理, 版本控制, 代码分享, 项目协作, 协同开发平台' }` ;
document.querySelector(`meta[name='description']`).content = description + ' | GitLink';
document.querySelector(`meta[name='description']`).content = description;
document.querySelector(`meta[name='go-import']`).content = host + url + ' git ' + origin + url;
document.querySelector(`meta[name='octolytics-dimension-user_login']`).content = owner;
if (projectId) {