How to Build an RSS Feed for Jekyll


An RSS feed is nothing more than an XML document following a known format. Adding one to a Jekyll site is relatively easy and straight forward. As with all changes to your site’s structure it’s best to use your version control system to create a branch in case something goes horribly wrong.

Start by creating a new file at the root of your website. It should be a peer to your index.html file. Since the previous version of my site called the feed atom.xml that’s what I called it for the Jekyll version. The XML file has some meta information about the feed and then a loop which creates entries.

{% raw %}
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title type="text" xml:lang="en">{% site.rss_desc %}</title>
  <link type="application/atom+xml" href="https://zanshin.net/feed/" rel="self" />
  <link type="text" href="https://zanshin.net" rel="alternate" />
  <updated>{% site.time | date_to_xmlschema %}</updated>
  <id>https://zanshin.net</id>
  <author>
    <name>Mark H. Nichols</name>
  </author>
  <rights>Copyright (c) 1996-2013, Mark H. Nichols; all rights reserved.</rights>

  {% for post in site.posts limit:20 %}
  <entry>
    <title>{% post.title %}</title>
    <link href="https://zanshin.net{% post.url %}" />
    <updated>{% post.date | date_to_xmlschema %}</updated>
    <id>https://zanshin.net{% post.id %}</id>
    <content type="html">{% post.content | xml_escape %}{% include rss_footer.html %}</content>
  </entry>
  {% endfor %}
</feed>
{% endraw %}

You of course will need to change the site references to match your site, along with the author information.

Within the for loop that builds the individual entries this line is worth extra attention.

{% raw %}
    <content type="html">{% post.content | xml_escape %}{% include rss_footer.html %}</content>
{% endraw %}

All content must be escaped for XML. Here the post.content passes through a Liquid filter that properly escapes angle brackets and quotes for XML. I’ve added a footer that appears only in my RSS feed. Since this does not pass through the xml_escape Liquid Filter like post.content does, I had to make sure that it was properly escaped. The rss_footer.html files is in my _includes directory.

{% raw %}
&lt;hr /&gt;
  &lt;p&gt;
    You should follow &lt;a href=&quot;http://twitter.com/zanshin&quot; title=&quot;Follow me on Twitter&quot;&gt;me on Twitter&lt;/a&gt; and on &lt;a href=&quot;http://alpha.app.net/zanshin&quot; title=&quot;Follow me on App.net&quot;&gt;App.net&lt;/a&gt;. You should also subscribe to &lt;a href=&quot;http://twitter.com/zanshinnet&quot; title=&quot;@ZanshinNet on Twitter&quot;&gt;@ZanshinNet&lt;/a&gt; on Twitter for site updates.
  &lt;/p&gt;
{% endraw %}

It looks ugly but it works.

With the atom.xml file in place (and the rss_footer.html file too, if you are using one) simply regenerate your site and the feed will be created.


A Usable Credit Card Form


If your website’s credit card form has the words “no spaces or dashes” on it then you need creditcardjs. Simple, clear, usable, easy. Makes me wish my site had need for a credit card form.


Save Video from Dropbox to iOS Device


In preparation for a presentation she is giving tomorrow my wife wanted to load a short technique video on to her iPad. She had the video in Dropbox but was unable to save it to the device. Clicking on a picture and then on the “save to device” icon works, but for videos this icon is greyed out, it is unavailable.

Videos are sufficiently large that they aren’t saved to the iOS device, they are held in memory. Only by making them a favorite will Dropbox save them so that they reside in local storage.

Here then, is the trick to saving videos to your iOS devices from Dropbox. Select the video in Dropbox and let it synchronize to your device. Now tap the “star” icon to make it a favorite. Next tap the “Favorties” menu.

With the Favorites menu selected, the “save to device” option is now available. Tap it and select “Save to Photo Library”. The video is now available on the iOS device inside the Photos app.


Zero Motorcycles


All-electric motorcycles. Looks like something worth checking out.


Developing iOS7 Apps for iPhone and iPad


Even if you never write and release an iOS app, this Stanford University course is well worth the time and effort. Paul Hegarty is a superb instructor and the course is simply outstanding.


250000 Page Views


While I was off updating the backend for my site to Jekyll the overall page count passed 250,000. As of this morning 253,663 page views to be reasonably exact. What’s interesting is the recent increase in daily page views. For most of this year I’ve had in the neighborhood of 200 visits per day. In the last two weeks this number has jumped to 300+ visit per day. Posting activity here has been a bit slow recently, so I’m at a bit of loss to explain the sudden up turn in views. Not that I am complaining.


Zanshin.net Refresh


Over the weekend I pushed a new version of zanshin.net out into the wild. I’ve been wanting to redesign my site for a while now and I’m quite pleased with the new leaner look of things. In addition to a new theme I’ve switched from using Octopress to using Jekyll to drive the generation of the site. I’m working on a posting that will detail what it took to revamp the site.

If you find anything amiss please let me know via the email icon over in the socail media icon row in the sidebar.


Use RVM to Fix SSL Certificates


While trying to add a new gem to my development machine I got the following error message.

Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3
read server certificate B: certificate verify failed
(https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz)

A quick Google search lead me to this GitHub thread on the rubygems repository: gem 2.0.3 Unable to download data from https://rubygems.org. Scrolling down through all the comments I eventually discovered a link to Use RVM to Fix SSL Certificates.

The gist of the article is under the Use RVM to Fix SSL Certificates heading part way through the article. It seems that recent versions of RVM have the ability to update SSL certificates.

Run this command to see the current status:

$ rvm osx-ssl-certs status all
Certificates for /usr/local/etc/openssl/cert.pem: Old.

In my case the status was “Old”. Running this command updates the certificates:

$ rvm osx-ssl-certs update all
Updating certificates for /use/local/etc/openssl/cert.pem: Updating certificates in
'/usr/local/etc/openssl/cert.pem'.
Updated.

Rerunning the first command now shows everything up-to-date.

$ rvm osx-ssl-certs status all
Certificates for /usr/local/etc/openssl/cert.pem: Up to date.

Now the gem install command that originally was getting the certificate error works.


Let Him Be Safe in Sleep


Following the death of my father in September we received the many condolences. The poem below was included in one card and I find in particularly moving and meaningful.

SPELL OF SLEEP

Let him be safe in sleep
As leaves folded together
As young birds under wings
As the unopened flower.

Let him be hidden in sleep
As islands under rain,
As mountains within their clouds,
As hills in the mantle of dusk.

Let him be free in sleep
As the flowing tides of the sea,
As the traveling wind on the moor,
As the journeying stars in space.

Let him be upheld in sleep
As a cloud at rest on the air,
As a sea-wrack under the waves
When the flowing tide covers all
And the shells’ delicate lives
Open on the sea-floor.

Let him be healed in sleep
In the quiet waters of the night
In the mirroring pool of dreams
Where memory returns in peace,
Where the troubled spirit grows wise
And the heart is comforted.

by Kathleen Raine


Dad's Eulogy


Eulogy for George King Nichols.

Hello. My name is Mark H. Nichols. I want to thank all of you for being here today to remember my father.

George King Nichols had insatiable curiosity. His interests were wide and varied. He loved nothing more than a new topic to explore and understand. In my lifetime alone he built a sailboat, learned to make wine, studied bookbinding, completed an extensive genealogy of our family, became an outstanding photographer, learned accounting, reupholstered furniture, built furniture, completed the wiring, plumbing, and finish carpentry on an addition to his home, learned more than a little about computers, and continually strove to educate himself.

Dad was born in Wilkes-Barre Pennsylvania on September 4, 1925, and grew up in Falls, a small village on the Susquehanna River about 20 miles north of Scranton-Wilkes-Barre. His father, Basil Nichols was a section foreman for the Lehigh Valley Railroad for nearly 40 years. His mother, Hazel May King was the driving force in his family.

At age 7 he fell out of a tree breaking his right arm at the elbow. As a part of the healing process he was made to carry a pail of wet sand from the house, around the barn and back to the house. Each time he passed behind the barn he’d switch hands, as the sand was heavy. His mother, of course, knew this was going on and would add a lap at the end to make up the difference.

One time as a child he was invited to spend a day on the railroad with his father. At the mid-morning break everyone ate a little from his lunch pail. Dad was starving and was intent on eating everything in his pail. He was dismayed to learn it wasn’t even lunchtime yet.

In 1939 he was introduced to New York City when he and his mother traveled there by train for the Worlds Fair.

After two years of college at Penn State he went to Midshipman’s School and as an Ensign and later 2nd Lieutenant served as the auxiliary fire control officer on the USS Wisconsin. While he was on board, the Wisconsin completed her 2-year trials. I vividly remember him telling me about how the entire 800’ ship shook and vibrated as it moved through the water at more than 30 knots. He said when the ship fired a full broadside of all nine 16-inch .50 caliber rifles; the recoil would shove the ship sideways.

After completing his term of service to the Navy he returned to Penn State to complete his undergraduate degree. He worked as assistant manager and manager for GLF, a farm store chain in New York State for many years. At the outbreak of the Korean conflict his quick thinking showed itself. During WWII there had been a rubber shortage. Remembering that, he called the GLF warehouse and ordered all the tires they had. Borrowing a grain truck from the mill he went and picked them up. He then posted a sign in the window saying that they had tires. He sold them all before the news came out that synthetic rubber was now available and that the war in Korea would not cause a shortage.

He also figured out how to sell the then new power lawn mower. Putting one together at the store on a Saturday morning, he’d load it into the truck and drive around looking for someone using a push reel mower. He would unload the gas mower, pull the cord and start mowing along behind the guy. Once the guy asked for a chance to try my dad would make the sale. After selling several mowers this way his manager asked to come along to see how my dad was selling so many mowers.

Jobs for Standard Oil and American Cyanamid brought him to New York City again, where he stayed until 1962. At All Souls Unitarian Church in Manhattan he met Helen Riley, my mother. They were married on his birthday in 1960. In December of 1961 he took a job with the A. E. Staley Manufacturing Company here in Decatur. After a decade of many jobs he decided it was time to settle down to one job. He would work at Staley’s until his retirement in 1985. While there he was part of a team that patented a dry, compressible starch used in the manufacture of tablet pills. He very successfully managed the dextrose sweetener product. He also selected a new plant site for Staley’s in Lafayette Indiana.

He was busier than ever after retirement. He and my mother traveled extensively for the next decade with a travel trailer. They traveled from Maine to British Columbia, from Texas to California, and everywhere in between. He also began to attend photography seminars and started taking large format black-and-white pictures.

Together my parents traveled to England and Scotland and he was enthralled with the great cathedrals there. He returned by himself expressly to take pictures, but not before practicing long exposure pictures in central Illinois churches. My father wanted to know and understand a subject and was willing to practice in order to learn.

Upon becoming the treasurer for the Unitarian Fellowship he went to the library and checked all their books on accounting to teach himself. He delighted in any endeavor that allowed him to explore a new subset of the Dewey Decimal system.

For many years completing an extensive family genealogy filled his need for research and exploration. He traveled to libraries all over the country and researched hundreds of records and documents. My middle name, Hanford, is a family name. Chris and I are the 13th generation of our family in this country. Francis, Caleb, Abraham, Asa, Daniel, Nathan, Issac Sr., Issac Jr., Hanford, George Hanford, Basil, George, Mark and Christopher.

Photography was his great passion. He pursued it with all the intellectual might he could bring to bear. He would set up still life subjects of flowers or old shoes and take image after image, spending hours standing in the dark developing film and printing pictures from the negatives to learn how to coax the images he wanted from the camera.

After decades of learning the ins and outs of large format photography he plunged head first into digital photography. In the past few weeks he was considering buying a new iPhone 5s solely for the camera and the fact that it would always be in his pocket ready to use. He was signed up for a new photography seminar later this fall that included a discussion on use the iPhone to take pictures and he was curious to know.

His photographs hold special meaning as they give all of us a chance to see the world through his eyes.

For the past 5 years he shared life with Roberta. Together they traveled, went birding, hiked in the woods looking for wild flowers, attended concerts, and enjoyed each other’s company. Their relationship filled him with delight and happiness.

Both my brother Christopher and I were fortunate enough to travel with him as adults. This past spring Chris and Dad went to Washington DC to see the World War Two monument. And in July I went to Upper Peninsula Michigan with him to photograph waterfalls.

Chris and our father traveled to the American Southwest many years ago, including a stop along a very hot and dusty highway for a scenic picture. As Chris related the story to me, Dad sets up the tripod and then the 4x5 camera and its lens and hood, takes light readings, takes a test picture with the Polaroid back, more light readings, and finally the picture. While all this was happening, a car with dust covered windows slowed while the driver held up an instamatic camera and snapped a shot and drove off. Dad’s remark was that one of the two was right.

On a canoe trip I shared with him down the Current River in Missouri when it came time for dinner, he produced a frozen block of stew. We thawed it and had a perfectly delicious meal. He planned ahead and was willing to break convention when it suited him.

He imparted to me a love of books and of knowing - sometimes just for the sake of knowing. While I didn’t always see eye-to-eye with him I greatly valued his advice and council. I will miss his intellect, his humor, and the twinkle in his eye when he was full of mischief. I am honored to have had such a father as George Nichols, and I will be fortunate indeed to have a life as full and complete as his.

After three years of effort in the garage my father completed the building of a Snipe sailboat. On the day of its launching the belly band – a large canvas strap used to hoist it from the trailer to the water — broke, dropping the boat on the concrete. I turned to my Aunt Mary and said, “That’s my jolly Daddy.”

That’s my jolly Daddy.

Good-bye Dad.