This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
coryd.dev-eleventy/src/posts/2013/publishing-to-kirby-using-drafts-workflows.md

3.6 KiB

date title description tags
2013-08-20 Publishing to Kirby using Drafts workflows I have recently begun publishing content to my Kirby powered site using workflows from the endlessly-customizable Drafts.
iOS

I have recently begun publishing content to my Kirby powered site using workflows from the endlessly-customizable Drafts. The workflows I use send text formatted for my site's notes / blog template to Textastic. I then place the resulting text file in a folder named for the URL I want to assign to the post and push the folder to the appropriate content directory on my site.

My notes template uses four different text file names to differentiate between published content types and I have created a Drafts workflow for each name.

Text post workflow:

'textastic://x-callback-url/new?name=note.text.txt&text=Title:%20[[title]]%0D----%0DDate:%20[[date|%m.%d.%Y]]%0D----%0DText:%20[[body]]'

So, for example, if the following were placed in to a draft ...

Lorem ipsum dolor sit amet

Consectetur adipiscing elit. Suspendisse imperdiet ullamcorper accumsan. Duis et rhoncus odio. Vestibulum rhoncus nisl diam, non malesuada odio condimentum in. Morbi ut nisi nec erat viverra blandit at dapibus nibh.

... the workflow above would create a text file in Textastic named note.text.txt that contains:

Title: Lorem ipsum dolor sit amet
----
Date: 08.20.2013
----
Text: Consectetur adipiscing elit. Suspendisse imperdiet ullamcorper accumsan. Duis et rhoncus odio. Vestibulum rhoncus nisl diam, non malesuada odio condimentum in. Morbi ut nisi nec erat viverra blandit at dapibus nibh.

Link post workflow:

This would output the following ...

Lorem ipsum dolor sit amet

Consectetur adipiscing elit. Suspendisse imperdiet ullamcorper accumsan. Duis et rhoncus odio. Vestibulum rhoncus nisl diam, non malesuada odio condimentum in. Morbi ut nisi nec erat viverra blandit at dapibus bibh.

... as:

Title: Lorem ipsum dolor sit amet
----
Date: 08.20.2013
----
Link: https://google.com
----
Text: Consectetur adipiscing elit. Suspendisse imperdiet ullamcorper accumsan. Duis et rhoncus odio. Vestibulum rhoncus nisl diam, non malesuada odio condimentum in. Morbi ut nisi nec erat viverra blandit at dapibus nibh.

It's worth noting that this particular workflow is a bit messy inasmuch as I've included an arbitrary number of Drafts line tags to account for any additional paragraphs of text after the first. Using the body tag in this instance would result in the "Link: http://google.com" line being included with the text.

The final two post types / work flows I use are identical to the first aside from the name of the file they supply to Textastic. They are as follows:

Image post workflow:

'textastic://x-callback-url/new?name=note.image.txt&text=Title:%20[[title]]%0D----%0DWhen:%20[[date|%m.%d.%Y]]%0D----%0DText:%20[[body]]'

Gallery post workflow:

textastic://x-callback-url/new?name=note.gallery.txt&text=Title:%20[[title]]%0D----%0DWhen:%20[[date|%m.%d.%Y]]%0D----%0DText:%20[[body]]

Using these actions to publish content from Drafts to your Kirby-based site should be as simple as changing the file name sent to Textastic in each workflow. If you run in to any problems or have any suggestions for improving these workflows feel free to let me know.

Many thanks to Alex Duner and Nate Boateng for the Statamic Drafts workflow they provided to get me pointed in the right direction on this.