While running my Shave Country website, I was looking to add some articles to help with SEO. As the site was static other than that I didn't want to add a CMS and instead looked for a way to add the articles with minimal fuss.
Inspired by the Blot.im was using with Dropbox and what the NY Times was doing using Google Docs and ArchieML I decided to see if I could whip up something using a similar approach.
- A server running PHP
- A Google account with Google Docs
- A draft folder
- A published folder
- A Zapier account
- Two Zaps:
- To monitor the drafts folder
- To monitor the published folder
- Two Zaps:
- A Sparkpost account
- Turns Google Docs using Markdown into HTML files via templates
- Generats an index of the articles you publish
- Allows for preview versions of content (which create the file but don't update the index)
- Sends email notifications when previews are created or articles published
Zapier monitors a pair of folders in a Google Docs account (a draft folder and published one) and when a new file appears it posts the contents of that doc to the PHP file, which takes the supplied text and title, runs it through a Markdown formatter, then through some Twig templates, and then saves the file as index.html inside a URL safe folder created from the document's name.
- Update the templates in the template folder as required
- Update the CSS file in the css folder as reuired
- Add images in the img folder as required
- Update the settings in the api.php file
- Upload all of the folders and the api.php file to a publicly accessible server running PHP
- Create two folders in a Google Docs account:
- a drafts folder (to create drafts without adding to the index page)
- a published folder (where docs for articles that are published will reside)
- Create two Zaps, one for each folder, which:
- Monitor the designated folder in Google drive
- Post to the URL where the api.php can be found (i.e. https://your.domain/api.php)
- Pass the follow data as JSON:
- status (either draft or )
- title (the Title from the Google Doc)
- contents_txt (the File Txt from the Google Doc)
- auth_code (the random string you added to the settings in the api.php file)
- Do no wrape the request in an Array
- Do say Yes to the unflatten option
- PHP
- Twig (for templates)
- Sparkpost (to send email notifications)
- Zapier (to watch the folders in Google Docs)

