Editorial Workflows

New Jekyll Post

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Generates a new document with filename and data to use in a Jekyll blog.

Shared by: @josiahwiebe

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Select from List ?
Title
Post Type
List (Lines)
Post Link
Multiple Selection
OFF
Show in Popover
OFF
Change Case ?
  • UPPER CASE
  • lower case
  • Title Case
Set Variable ?
Variable Name
postType
Value
Input
Request Text Input ?
Title
Post Title
Initial Text
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
postTitle
Value
Input
If… ?
Run the block if
postType
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
link
Request Text Input ?
Title
Link URL
Initial Text
Clipboard
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
eurl
Value
Input
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import editor
import datetime

#gather variables
post_title = workflow.get_variable('postTitle')
post_type = workflow.get_variable('postType')
post_eurl = workflow.get_variable('eurl')

#generate filename
file_name = datetime.datetime.now().strftime('%Y-%m-%d')+'-'+post_title.lower().replace(' ','-')+'.markdown'

#generate post title
post_title_case = post_title.title()
post_date = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')

#generate post metadata
if post_type == 'link':
	post_header = '---\nlayout: post\ntitle: '+post_title_case+'\ndate: '+post_date+'\nlink: '+post_eurl+'\n---\n\n\n'
else:
	post_header = '---\nlayout: post\ntitle: '+post_title_case+'\ndate: '+post_date+'\n---\n\n\n'

#generate a file with the generated file name and content
editor.set_file_contents(file_name,post_header)

#return the filename to the workflow.
workflow.set_output(file_name)
Open Document ?
File Name
%var:Input
In Dropbox
OFF