首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >有没有办法在AMP列表中使用博客?alt=Json提要?

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

Stack Overflow用户
提问于 2020-08-29 05:42:10
回答 2查看 185关注 0票数 4

我见过使用src="example.com/json“的amp-list。但是有没有办法在amp-list中使用blogger json feed呢?

代码语言:javascript
复制
<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>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-09-08 23:31:26

是的,有一种方法可以在amp列表中使用blogger JSON;为此,您需要提到items='feed.entry'以进入JSON的细分,然后遵循八字胡模板指南来获取所需字段。

票数 2
EN

Stack Overflow用户

发布于 2020-09-01 15:53:57

您应该能够通过使用以下模板配置来呈现来自博客提要的数据-

代码语言:javascript
复制
<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>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63641205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档