首页 > 解决方案 > 有没有办法在 AMP-list 中使用 Blogger ?alt=Json 提要

问题描述

我已经看到使用 src="example.com/json"的amp-list 。但是有没有办法在 amp-list 中使用博主 json 提要?

<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>

标签: bloggeramp-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>

推荐阅读