The following Ruby code generates the Atom feed of my website. It is composed of three parts:

Org Mode is instructed to generate a site.atom file upon execution of this source block.

Warning! Executing this piece of code is not enough to publish the feed, since the site.atom file is created in the current directory. We need to ensure sitemap.xml is also copied into the _site directory. This is guaranteed by the order in which we execute the site generation commands. More in details, if we first process the org-mode files and then manage the “random bits in home”, we should be pretty sure the sitemap is copied.

title       = "Adolfo Villafiorita's Homepage"
author      = "Adolfo Villafiorita"
description = "Homepage of Adolfo Villafiorita"
url         = ""
email       = ""

atom_filename = "site.atom"
atom_template = <<EOS
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="">
  <title><%= title %></title>
  <link href="<%= url %>/site.atom" rel="self" type="application/rss+xml" />
  <link href="<%= url %>"/>
  <updated><%= %></updated>
  <author><name><%= author %></name></author>
  <id><%= url %></id>

  <%- pages.each do |page| -%>
    <title><%= page["TITLE"] %></title>
    <link href="<%= page[:url] %>"/>
    <id><%= page[:url] %></id>
    <updated><%= (DateTime.parse(page["DATE"]) || %></updated>
      <%= page["DESCRIPTION"] || page[:excerpt] %>
  <%- end -%>

require 'erb'
load '_scripts/metadata.rb'

pages = Metadata::collect("notes/").select { |x| not ["notes/", "notes/"].include?(x[:filename]) }
renderer =, nil, "-")
content = renderer.result(binding)

Author: Adolfo Villafiorita

Last modified: 2020-04-03 Fri 18:43 (created on: 2020-03-11 Wed 00:00)

Published: 2020-06-05 Fri 18:24