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

332 Views Asked by At

i have seen the amp-list using src="example.com/json". but is there is a way to use blogger json feed inside amp-list?

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

There are 2 best solutions below

4
Prayag Verma On

You should be able to render the data from a Blogger feed by using the following template configuration -

<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>
0
iswarya menon On

Yes there is a way to use blogger JSON in amp list; 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.