LDG
jekyllstatic-site-generatorauthor-attributionliquidyaml
Abstraction: Jekyll blog author attribution via _config.yml data
Key points:
- Originally hard-coded author name and Gravatar hash directly in each post's YAML front matter — tedious to copy/paste across posts
- Better approach: define author objects in
_config.ymlunder anauthorskey (display_name, gravatar, email, web, twitter, github fields) - All
_config.ymlkeys are exposed in Liquid templates via thesitevariable (since Jekyll 0.5.2) - Post front matter needs only
author: matt; template retrieves data with{% assign author = site.authors[page.author] %} - Author data can be reused across the site (e.g., About page), not just in post templates
- Eliminates copy/paste errors and centralizes author metadata in one file
Connections: Jekyll · Static Site Generation · Template Language
Source: http://www.lostdecadegames.com/blog-author-attribution-using-jekyll/