您如何在Google richsnippets测试工具中测试AngularJS Web应用程序的schema.org元标记? [英] How do you test the schema.org metatags of an AngularJS webapp in Google richsnippets testing tool?
问题描述
该网站的代码是使用AngularJS javascript框架生成的.当我访问网页时,它会完整显示该页面,但是源代码是由源代码中不完全存在的部分加载的,例如:
The code of the website is being generated with the AngularJS javascript framework. When I visit a webpage it displays the page completely, but the source code is being loaded by parts that are not fully present in the source code, for example:
<body>
<div class="wrapper">
<div ng-include="'partials/header.html'"></div>
<div id="ng-view" ng-view class="main_view wrapper"></div>
<!--div ng-include="'partials/home_content.html'"></div-->
<a href="#"> </a>
</div>
<div ng-include="'partials/footer.html'" class="footer"></div>
</body>
如何在 https://www中测试部分代码(页眉,内容,页脚). google.com/webmasters/tools/home ?
推荐答案
我使用的是名为 prerender 的软件,以确保抓取工具实际上可以抓取我的单个页面应用程序站点以便对其进行索引.
I'm using a software called prerender to ensure that crawlers can actually crawl my single page application site in order to index them.
因此,我只给测试工具提供一个经过渲染的页面即可工作,我认为这是个好主意,因为这正是爬虫仍将如何获取您的页面的方式.
So I just give the testing tool a prerendered page to work on, and I think it's a good idea, because that's exactly how crawlers will get your page anyway.
我正在使用prerender,可以将其安装在您的服务器上或通过其服务器使用(收费),有关更多信息,请参见:
I'm using prerender, which can be installed on your server or used through their servers (for a price), more info at : https://prerender.io/documentation
这篇关于您如何在Google richsnippets测试工具中测试AngularJS Web应用程序的schema.org元标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!