根据this article ,LinkedIn支持用于链接预览的开放图元标记。我已经在HTML页面的头部添加了所有必需的meta标签。
即
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Primary Meta Tags -->
<title>This is sample title</title>
<!-- Open Graph / Facebook / LinkedIn -->
<meta property="og:type" content="website">
<meta property="og:title" content="This is sample title">
<meta property="og:description" content='sample description'>
<meta property="og:image" content="image path">
</head>
<body></body>
</html>
但是当我在LinkedIn上共享我的链接时,LinkedIn不会在链接预览中获取描述。
同一链接在facebook上正常工作,因为facebook也支持开放图元标记。
我想念什么吗?
是否有任何类型的验证可用于描述?
在您指定的所有打开图的元元素中,您错过了ogp的名称空间,该名称空间使用前缀元素prefix="og: http://ogp.me/ns#"
表示。从Open Graph guide:
<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
...
</head>
...
</html>
因此,您的meta元素没有指向库的链接来确定其值。以下语法可能对您的标记有所帮助:
<!DOCTYPE html prefix="og: http://ogp.me/ns#">
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Primary Meta Tags -->
<title>This is sample title</title>
<!-- Open Graph / Facebook / LinkedIn -->
<meta property="og:type" content="website">
<meta property="og:title" content="This is sample title">
<meta property="og:description" content='sample description'>
<meta property="og:image" content="image path">
</head>
<body></body>
</html>