Docs to Jekyll

After knocking my head against the wall a few times, I think I have a pretty good system now for going from Docs to Jekyll. I’m really happy about this.

Here are the steps for writing a new post

  • Title the document with the same name I want for the final file that I’ll use in Jekyll

  • Add the YAML frontmatter (for new docs I usually just make a copy of an old one)

  • Write in Google Docs using its formatting options. (I don’t write Markdown.)

When I want to build, I do the following

  • Download the directory from Drive (by default it’s a zip of .docx files)

  • Run a shell script to convert .docx to Markdown using Pandoc1

Here are my favorite things about it

  • As mentioned, I can write with Google Docs for formatting. Links are just links instead of taking up half an entire line showing URLs with Markdown.

  • Oh yeah, and footnotes work. I can write footnotes with the cmd+alt+F shortcut. And I don’t have to fumble around with thinking about where to place the markdown footnote tags.

  • When filling links in, I can use the research panel (ctrl+shift+cmd+i) in Google Docs to add links without switching tabs. Anything to keep me from browsing and getting distracted.

  • There are good Markdown extensions for Google Docs but I haven’t had luck doing batch conversions. This seems to solve that.

Some things I’ll worry about when I get to them

  • Streamline the image process. It’d be nice to have the images pasted directly into Docs. Maybe I can do a combination of pasting the image in Docs and adding the corresponding URL below it in Markdown so it’ll appear in the converted file.

  • Try a code block and figure out how to fix it. I imagine it won’t work that well at first but I’m not too worried yet, because I don’t have plans to write about anything code related for a while.

  • I can’t build the site from Docs. That’s a positive for me because having terminal or IDE leads to tinkering which distracts from writing. But I can get to where I feel something is complete. Instead of thinking “I’ll fix these links and images when I get to the real Markdown files. Then the almost finished files pile up. That’s what happened with about a dozen of the first 20 posts.

I’m pretty excited about this but we’ll see if it holds up for the rest of this project.

  1. The shell script also does a few string replacements in cases to deal with inline style tags and images. This might get a little hairy if I include code blocks but I’ll cross that bridge when I get to it.