Mr. Poole is an Alfred.app workflow for Jekyll sites. He is Dr. Jekyll's butler and tries to take the drudgery out of running a static site. Mr. Poole will assist you by...
New draft: Add the title as an argument. It creates a new draft file in the _drafts folder of your Jekyll site, then adds a front matter template with the title and default values defined in the script. The filename is the lowercase, hyphenated version of the title.
New link post draft: Reads the URL, title and selection from the active Safari tab and creates a new linked-list style draft with the page title, date, external URL and the selection (as Markdown quote) filled in. Requires modified Jekyll templates (cf. below).
New video post draft: Reads the video ID, title and selection from a Youtube or Vimeo video page in Safari and creates a new video post draft with the page title, date, video ID and the selection (as Markdown quote) filled in. Requires modified Jekyll templates (cf. below).
Open draft: Returns all of your existing drafts sorted by modification date (newest first). Selected post will be opened.
Publish draft: Lets you choose an existing draft, adds the current date to the beginning of the filename and moves it to the _posts folder. Builds the site and deploys it to your remote server. Opens your site in the standard browser.
Open post: Returns a list of your existing posts in reverse chronological order and opens the selected post for editing.
Tweet post: Requires a page on your domain in the active window / tab of Safari. Reads the URL and the title and opens an editable tweet about the article. Requires Tweetbot for Mac.
New page: Takes a page name as an argument. Creates a markdown page file. The filename is the lowercase, hyphenated version of the title.. Fills in a template front matter with the title and default values defined in the script. It creates subfolders if given. Example: The argument /resources/A list of my downloads/
will create the file path/to/jekyll/resources/a-list-of-my-downloads.md
.
Open page: Returns a list of all .md files inside the Jekyll folder including subdirectories sorted by date of last modification, excluding only those in folders prefixed with an underscore such as _posts
and _drafts
. Opens selection for editing.
Deploy site: Builds the site and uses rsync to deploy it to the remote server. Opens the URL in the browser.
Serve site: Builds the site with drafts, starts the local server and opens the URL. Regenerates the site when files are changed.
Edit site: Same as Serve site, but additionally opens the site folder in Sublime Text.
To use this workflow with only the modifications listed in the next section, you need to have...
Link and video posts do not work with a standard Jekyll setup. You have to modify your site to support these post formats. Two starting points might be my short blog posts on link posts and video posts with Jekyll (which lead back to GitHub for detailed instructions).
To get started, go through each of the script filters and scripts and do the following:
_drafts
folder inside your site directorysitedir
, extension
and other variablesI'm a noob and did this to learn a little bit about shell scripts. The workflow is functional on my Mac, but it can certainly be improved. If you encounter any problems or have suggestions, please use this repository's issue tracker.
date:
line in the post's YAML front matter with a line containing current date and time to ensure the correct order of multiple posts from the same date