RSS for a static site

I have a site, deanvmc.me, which I use to teach myself HTML, CSS and JavaScript. The site is specially static to take away my training to carry bones (the best way to find out how I feel). I use github as a host to block me to statically generated content.

I would like to post some articles and manuals on this site and feel that it would be nice to offer an RSS feed for both. Directories / Articles and / Tutorials will be used to display content with actual posts in the form / Articles / and / Tutorials / respectively.

I looked around, but any tutorial I found seems to rely on me using one of the main CMS engines that I don't.

I understand that RSS was longer than CMS engines, so my question is: is it possible to syndicate my static site?

+4
source share
4 answers

It’s a little harder with static sites to get an RSS feed because you can end up duplicating content if you are not ready to add another tool to generate your site or you are programming a bit (and maybe the language is different from the ones you use currently.)

As @Simone noted, RSS is a simple format and easy to write. But if you just write an RSS feed on top of what you are doing right now, you will obviously duplicate some or all of the content on the site, which is not ideal.

So, I would advise that you need to use your content and convert it to an RSS feed - or vice versa.

When I created a static content site with an RSS feed, the way I did it was to start with an RSS feed. Then I wrote code that would use the RSS feed and create my HTML articles. In my case, I used XSLT to convert RSS to a series of HTML files, but you could use whatever technology you want.

Then, when I wanted to add an article to my static site, I would edit the RSS feed to add a new article with a new date, etc. (and there are tools for different platforms for manually creating RSS feeds like this.) Then I ran my code that “burned” my HTML articles, so I always get static articles and RSS feeds in accordance with each other, and only one "source", a copy of the content.

There are also tools for various platforms that can automate or semi-automate the creation of an RSS feed from many things on disk, which is a way to approach the problem from a different direction.

Therefore, I answer that if you are not ready to add a language or tool other than CSS, HTML and Javascript to your repertoire, there is no satisfactory way to add an RSS feed to a static site. If you just added it as a static file created manually, then you need to update your content in two places if you are editing an article, for example.

You can also learn a lot about how the modern crop of tools for creating static RSS-based sites is Jekyll , or its more reasonable derivative of Octopress , for example, complete an assignment.

+5
source

I am using a static site generator for my blog ( alexanderle.com ) and have encountered this problem.

I decided to create an RSS feed from scratch and it works great! It’s pretty easy to automate if you have access to a template system or database. Editing XML is not at all that difficult - if you can write simple HTML, you can edit the XML RSS file.

Check out the alexanderle.com/blog/2012/create-an-rss-feed-from-scratch.html manual!

+7
source

RSS is simply an XML file that follows some specific conventions. You can write XML manually, but the task is tedious, especially if your site posts a lot of changes daily. For this reason, the RSS file is usually generated by your CMS.

Here you can find the RSS 2.0 specification.

Here is a very simple RSS file.

<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> <channel> <title>RSS Title</title> <description>This is an example of an RSS feed</description> <link>http://www.someexamplerssdomain.com/main.html</link> <lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate> <pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate> <item> <title>Example entry</title> <description>Here is some text containing an interesting description.</description> <link>http://www.wikipedia.org/</link> <guid>unique string per item</guid> <pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate> </item> </channel> </rss> 

Each items has a feed entry.

+3
source

Yes, you can have an RSS feed for any site, but it is advisable for those that you add or change from time to time.

Just write an XML file, for example. using RSS 2.0 and download it.

Add a meta tag to the top of your web page.

 <link rel="alternate" type="application/rss+xml" title="My Test Feed" href="http://www.mysite.com/rss.xml" /> 
+1
source

All Articles