Mail2FrontMatter::AutotagSubject
Mail2FrontMatter plugin for extracting tags from an email subject line by convention.
Installation
Add this line to your application's Gemfile:
gem 'm2fm-autotag-subject', require: false
And then execute:
$ bundle
Configuration
In your Mail2FrontMatter YAML configuration enable the plugin by adding it to your preprocessors:
protocol: imap
receiver: yourblogemail@yourdomain.com
senders: yourpersonal@yourdomain.com
preprocessors:
- key: 'autotag-subject'
mailman:
server: imap.gmail.com
port: 993
ssl: true
username: yourblogemail@yourdomain.com
password: yourpassword
Usage
Now when you send an email to yourblogemail@yourdomain.com
your subject line will be parsed for tags within brackets like:
to: yourblogemail@yourdomain.com
subject: [revelations, thoughts] My Amazing Revelation Today
body:
...
AutotagSubject will add 'revelations' and 'thoughts' and remove it from the the title. So your metadata will look like:
{
tags: ['revelations', 'thoughts']
title: "My Amazing Revelation Today"
}
Which will later get transformed to YAML for your static site.
That's it!
Contributing
- Fork it ( https://github.com/[my-github-username]/m2fm-autotag-subject/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request