我看到了使用src="example.com/json";。但是有没有一种方法可以在amp列表中使用bloggerjson提要?
<amp-list width="auto" height="140" layout="fixed-height"
src="https://example.blogspot.com/feeds/posts/default?alt=json">
<template type="amp-mustache">
-----
</template>
</amp-list>
您应该能够使用以下模板配置-来呈现Blogger提要中的数据
<amp-list width="auto" height="140" layout="fixed-height" items="feed.entry" src="...?alt=json">
<template type="amp-mustache">
<div class="title">{{#title}}{{$t}}{{/title}}</div> <!-- Shows the title of the post -->
<div class="content">{{#content}}{{{$t}}}{{/content}}</div> <!-- Shows santized content -->
</template>
</amp-list>
是的,有一种方法可以在amp列表中使用blogger JSON;为此,您需要提到items='feed.entry'
才能进入JSON的子部分然后按照胡子模板指南获取所需的字段。