Skip to content

Commit

Permalink
[fix] facebook share bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-jj committed Feb 6, 2024
1 parent 3c97274 commit f373900
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/gopcomm/yap/article_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,15 @@ <h1 class="my-4 text-4xl font-extrabold leading-tight text-gray-900">

editMetaUrl()
function editMetaUrl(){
// 获取当前页面的 URL
// Get the URL of the current page
var currentUrl = window.location.href;

// 查找 <meta> 标签中的 og:url 属性
// Find the og: URL attribute in the<meta>tag
var ogUrlMeta = document.querySelector('meta[property="og:url"]');

// 如果找到了 <meta> 标签并且 og:url 属性存在
// If the<meta>tag is found and the og: URL attribute exists
if (ogUrlMeta) {
// og:url 属性的内容设置为当前页面的 URL
// Set the content of the og: URL attribute to the URL of the current page
ogUrlMeta.setAttribute('content', currentUrl);
}
}
Expand Down

0 comments on commit f373900

Please sign in to comment.