In this tutorial we will learn, how to show post excerpt in atoms feed of octopress. After installing Octporess in Linux system, I am still exploring many things. For blogging platform,I mostly use and install wordpress.In recent time,the octopress came up with promising new blogging platform.
It is quite obvious some good features of WordPress,I was also looking into Octopress.
For default RSS ,Octopress has atoms feed.
Now here,my requirement is in atoms feed,the post must be shown with excerpt. In other terms,the post summary should be seen in atoms feed rather than full detail
To prevent from content copy dump scrappers, I was looking for post summary/excerpt in atoms feed.
Through RSS feed , these scrappers steal your whole content and make duplicate content in Internet world. Hence,the search engine like Google, skip the duplicate content site search.
In some case,I have also seen the result shows before the original source website.
To show post excerpt in atoms rss feed of octopress,Follow given below steps
Step 1: Edit the file atom.xml . I prefer to edit the atom.xml file which is located in Octopress theme directory.
For example, inside classic octopress theme directory , replace post.content with post.excerpt in atom.xml file (See line number 24)
Edit the file
For example, in atom.xml file inside classic theme directory. replace post.content with post.excerpt (See at line number 24)
See in blow given screenshot (post.content is replaced with post.excerpt)
Step 2: Now create a new post in Octopress by using command
rake new_post["This is an example post"]
In newly created post or existing post, add excerpt: and give description in summary.
See below given example.
In this example,we are editing post file. And added excerpt parameter in post file (See in below given screenshot)
Step 3: Because we are doing first time editing of octopress theme editing for RSS.We have to rerun the install theme command once again.
Note: Run install theme command only one time after editing any theme related file.
(Replace the classic with your theme name)
Now generate the html file once again.And check the result in preview by clicking on RSS link.
rake generate rake preview
In below given screenshot, octopress rss is showing excerpt in atom feed
NOTE: You can also edit the atom.xml file located in Octopress directly to octopress/source/ .Means it is not necessary to edit the atom.xml file inside of Octopress theme.
Leave a Reply