Skip to content

Instantly share code, notes, and snippets.

@zerowidth
Created April 8, 2013 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerowidth/5334031 to your computer and use it in GitHub Desktop.
Save zerowidth/5334031 to your computer and use it in GitHub Desktop.
Jekyll liquid tag for creating atom ids for atom feeds
module Jekyll
module AtomId
# from http://diveintomark.org/archives/2004/05/28/howto-atom-id
def atom_id(post)
"#{post["date"].strftime("%Y-%m-%d")}:#{post["date"].to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::AtomId)
@zerowidth
Copy link
Author

Hmm, I never considered if this would work with multiple posts on the same day...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment