How to embed RSS feed in a page - PaperMod theme

I would like to embed the feed RSS of my Telegram channel on a page.

Is it possible, and how?

https://gohugo.io/functions/transform.unmarshal/#xml-data

Thank you.

How can I use the following code?

{{ with resources.Get "https://example.com/rss.xml" | transform.Unmarshal }}
    {{ range .channel.item }}
        <strong>{{ .title | plainify | htmlUnescape }}</strong><br />
        <p>{{ .description | plainify | htmlUnescape }}</p>
        {{ $link := .link | plainify | htmlUnescape }}
        <a href="{{ $link }}">{{ $link }}</a><br />
        <hr>
    {{ end }}
{{ end }}

I woul put the feed RSS inside the page to view the Telegram channel content.

Sorry, but I don’t understand your question.

The page you sent contains some code, but I wondered how to set the code in practice.
My final goal is to have a page online containing the Telegram channel contents.

Maybe start with a shortcode.

Sorry, can you make an example?
Should I create an HTML file, or can I put a shortcode into the page?

Please start by reading this:
https://gohugo.io/templates/shortcode-templates/

It explains how to create and call a shortcode.

Thank you

In the beginning, I thought to realize the page by using the RSS feed of my Telegram channel.
I solved embedding two widgets on a page without shortcodes.
I needed to embed my Twitter account timeline and my Telegram channel.

I describe the steps I followed to the benefit of all.

Firstly I generated two widgets:

  1. to generate the Twitter timeline widget, on this page: https://publish.twitter.com/
  2. to generate the Telegram channel widget, on this page: Telegram Channel Preview Widget Generator

Secondly, I created the page’s content as follows (I obscured with xxxxx my information):

+++
title = "T&T"
date = 2022-01-07T02:13:50Z
author = "NicFab"
description = "Twitter & Telegram"
[cascade._target]
  kind = 'page'
  lang = 'en'
menu = "main"

+++


On this page our recent activities on Twitter ([**@xxxxx**](https://www.twitter.com/xxxxx)) and on our Telegram channel ([**@xxxxx**](https://t.me/xxxxx)). 


<br>

## Our Twitter Timeline

<br>

<center>

| <center><img src="/images/twitter-logo.png" width="150"></center> |
|:--:| 
| <strong><a href='https://www.twitter.com/xxxxx'>Follow us on Twitter</a></strong> |

</center>


<br>

<a class="twitter-timeline" data-height="1500" data-dnt="true" href="https://twitter.com/xxxxx?ref_src=twsrc%5Etfw">Tweets by xxxxx</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<br>

<br>

## Our Telegram channel

<br>

<center>

| <center><img src="/images/telegram-logo.png" width="150"></center> |
|:--:| 
| <strong><a href='https://t.me/xxxxx'>Join us on Telegram</a></strong> |

</center>

<br>


<iframe id="preview" style="border:0px;height:1000px;width:700px;margin:5px;box-shadow: 0 0 16px 3px rgba(0,0,0,.2);" src="https://xn--r1a.website/s/xxxxx"></iframe>

Now it works properly, and it was just what I wanted.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.