Editorial Workflows

Hugo : New 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: Simple workflow to create frontmatter for a new Hugo blog post

Shared by: @jimmyselgen

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Request Text Input ?
Title
Post Title
Initial Text
Untitled
  • Single Line
  • Multiple Lines
Keyboard Options:
Set Variable ?
Variable Name
Title
Value
Input
Set Variable ?
Variable Name
slug
Value
“”
Run Python Script ?
Source Code
#coding: utf-8
import workflow

# Get the custom parameters as a dictionary (titles are keys):
params = workflow.get_parameters()
# Get the action's input (a string):
action_in = workflow.get_input()
title=str(workflow.get_variable('Title'))
tokens=title.split(' ')
slug=''
for t in tokens:
	slug+=t+'-'
slug=slug[:-1]
workflow.set_variable('slug',slug.lower())
#...

workflow.set_output(action_in)
Set Variable ?
Variable Name
Filename
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow

action_in = workflow.get_input()

#workflow.set_variable('Title',action_in)
fname=str(workflow.get_variable('slug'))
filename='{0}.markdown'.format(fname.lower().replace(' ','-'))
workflow.set_variable('Filename',filename)
workflow.set_output(action_in)
Create Document ?
Filename
Filename
Content
--- date: "Year: 2001-Month: 01-Day: 01THour: 01 (24h):Minute: 01:Second: 01+00:00" title: "Title" slug: “slug” tags: [] subtitle: "" draft: true --- %cursor
Open in Editor
ON