angular - Angular10将脚本标签添加到谷歌职位发布的索引中
问题描述
如果你想使用谷歌职位发布,你需要在 HEAD 中添加一个 scripttag。请参阅下面的示例,我将 JSON 做得更小一些。
<html>
<head>
<title>Software Engineer</title>
<script type="application/ld+json">
{
"@context" : "https://schema.org/",
"@type" : "JobPosting",
"title" : "Software Engineer",
"description" : "<p>Google aspires to be an organization that reflects the globally diverse audience that our products and technology serve. We believe that in addition to hiring the best talent, a diversity of perspectives, ideas and cultures leads to the creation of better products and services.</p>",
"identifier": {
"@type": "PropertyValue",
"name": "Google",
"value": "1234567"
},
"datePosted" : "2017-01-18",
"validThrough" : "2017-03-18T00:00",
"employmentType" : "CONTRACTOR",
"hiringOrganization" : {
"@type" : "Organization",
"name" : "Google",
"sameAs" : "http://www.google.com",
"logo" : "http://www.example.com/images/logo.png"
},
}
</script>
</head>
<body>
</body>
</html>
我试图实现这个 bij 在特定组件中创建脚本元素。问题是这个脚本没有出现在页面源中。有没有办法做到这一点?
多谢
解决方案
是的,将script
标签添加到index.html
. 您不能将script
标签添加到组件的 html 中,至少我不知道。
推荐阅读
- excel - 如果在同一工作表中满足条件,如何复制列
- swift - 如何在不使用 MasksToBound = False 的情况下向 TableView 添加阴影
- xml - 如何为记录导出和格式化 XML?
- python - Python return 在之前的函数中触发 else
- python - Python Tkinter time.sleep 与 selenium webdriver 循环等效?
- c++ - 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)c++ clion
- regex - 在使用 Perl 和 AutoHotKey 的 RegEx 方面需要帮助
- yaml - Github 操作中对已安装 sdk 的依赖
- google-apps-script - Apps 脚本中 Google 表格中行高亮的 3 种状态
- python - 无法将 NLTK 导入 Jupyter Notebook