简体   繁体   English

有没有办法在 AMP 列表中使用 Blogger ?alt=Json 提要

[英]Is there is a way to use Blogger ?alt=Json feed in AMP-list

i have seen the amp-list using src="example.com/json".我已经看到使用 src="example.com/json" 的amp-list but is there is a way to use blogger json feed inside 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>

You should be able to render the data from a Blogger feed by using the following template configuration -您应该能够使用以下模板配置呈现来自 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>

Yes there is a way to use blogger JSON in amp list;是的,有一种方法可以在 amp 列表中使用博主 JSON; for that you need to mention items='feed.entry' to enter into sub divisions of JSON then follow the mustache template guidelines to fetch the required fields.为此,您需要提及items='feed.entry'以进入 JSON 的子部分,然后按照 mustache 模板指南获取所需字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM