0

I'm looking for advice on how to embed RSS feeds into either a static HTML website or a Hugo-generated template (mentioning that in case there's any Hugo-specific solutions).

My goal is to incorporate the most recent 3 blogposts from a specific RSS feed URL and display them (appropriately styling using CSS) on this external website that I'm working on.

All solutions I'm finding online are suggesting either outdated gmodules approaches or a 3rd party tool to accomplish this. It doesn't seem like it should be that complicated - by using the RSS feed URL in an <iframe /> element, it renders, so is there any reason this is a not recommended approach?

Are there any best practices for embedding RSS feeds in an iframe?

Are there better methods for embedding RSS feeds on a website that don't involve third-party tools?

Any guidance would be appreciated. Thanks!

IAspireToBeGladOS
  • 1,434
  • 3
  • 19
  • 34

1 Answers1

1

The point of an <iframe> is to imbed a second independent website inside the current page. So, in fact, you cannot style the contents of an iframe using the CSS of the outer page.

You can style it with javascript (see this answer) if they are in the same domain.

But if you are going to have to use javascript, it would be better to use AJAX.

mhhollomon
  • 965
  • 7
  • 15