end-to-end ios blogging integration with pythonista + gitlab + dropbox
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
config.py
mobile_blogger.py

README.md

Mobile Blogging Integration for iOS (Pythonista) + Editorial + Gitlab + Dropbox

alt text

Prerequisites

  • Pythonista for iOS
  • Gitlab
    • generate a personal access token
    • obtain the project id for the associated repo by running the following command, replacing with your Gitlab private token and with your Gitlab username:
      • %> curl -XGET --header "PRIVATE-TOKEN: <YOUR PRIVATE TOKEN>" "https://gitlab.com/api/v4/users/<YOUR USERNAME>/projects" | python -mjson.tool
      • then find the "id" for the relevant project—you'll need this for the post[gitlab_repo] config in config.py

Overview

This is a Pythonista script that integrates with the iOS share panel to allow you to use your favorite iOS markdown editor to create Jekyll posts and automate the following:

  • Creation the YAML front-matter for these posts using the post's main header and text input
  • Committing your post to your Gitlab repo. Yes, the irony of using Gitlab as an integration point for a Github project isn't lost on me, however, there are 2 reasons for this:
    • I don't use the built-in Jekyll integration with Github projects
    • I prefer to have my blog artifacts private and Github doesn't permit private repos for free accounts
  • Syncing files from repo to Dropbox

This is largely based on the work from Pascal Cremer, but updated for Gitlab (vs Github) and with the added integration with Dropbox.

Assumptions

  • Your Jekyll folder is stored in Dropbox ("Content Source") and is the basis from which your Jekyll instance generates your static site
  • Content Source is a Git project and hosted in Gitlab
  • You have shell access to a server with the Dropbox CLI client

Workflow

  • Write your blog post in Markdown (or Kramdown) in your favorite iOS editor (I use Editorial)
  • Click the Share option and run the Pythonista Share Extension Shortcut associated with this script
  • Enter the front-matter details in the UI form
  • Click Done; this will commit the post to your Gitlab repo, sync it to Dropbox and update

Notes

This integration commits the post to Gitlab and then syncs

See it Live

My website is built using Jekyll and posts are created using Editorial and this integration.

Feel free to contribute comments/improvements!