1
0
Fork 0
mirror of https://github.com/dilllxd/gitfolio.git synced 2024-08-14 22:28:09 +00:00

Add Open Graph and Twitter embed information

This commit is contained in:
K4USTU3H 2019-12-07 21:53:08 +05:30
parent 030e52b340
commit 0741978b3f

View file

@ -124,6 +124,18 @@ module.exports.updateHTML = (username, opts) =>
icon.setAttribute("type", "image/png");
document.getElementsByTagName("head")[0].appendChild(icon);
document.getElementsByTagName("head")[0].innerHTML += `
<meta name="description" content="${user.bio}" />
<meta property="og:image" content="${user.avatar_url}" />
<meta property="og:type" content="profile" />
<meta property="og:title" content="${user.login}" />
<meta property="og:url" content="${user.html_url}" />
<meta property="og:description" content="${user.bio}" />
<meta property="profile:username" content="${user.login}" />
<meta name="twitter:image:src" content="${user.avatar_url}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="${user.login}" />
<meta name="twitter:description" content="${user.bio}" />`;
document.getElementById(
"profile_img"
).style.background = `url('${user.avatar_url}') center center`;