Permalink
Browse files

Fully automate resume render process

  • Loading branch information...
relaxdiego committed Sep 23, 2017
1 parent ffebc53 commit 6b5b222ab3fa7cd6288111abfe99b79c13fbd665
Showing with 27 additions and 6 deletions.
  1. +4 −0 Procfile
  2. +0 −2 _config.yml
  3. +22 −3 render-resume
  4. +1 −1 resume/index.adoc
@@ -0,0 +1,4 @@
# Run this using Foreman via `foreman start`
# See: https://github.com/ddollar/foreman
web: jekyll server start
resume: ./render-resume
@@ -5,5 +5,3 @@ enforce_ssl: www.relaxdiego.com
permalink: /:year/:month/:title.html
highlighter: rouge
markdown: kramdown
gems:
- jekyll-asciidoc
@@ -1,4 +1,23 @@
#!/usr/bin/env bash
asciidoctor-pdf resume/index.adoc
mv resume/index.pdf resume.pdf
asciidoctor resume/index.adoc

# Requires fswatch https://github.com/emcrisostomo/fswatch
# `brew install fswatch`

function render_resume {
set -x
asciidoctor-pdf --base-dir ./ resume/index.adoc
mv resume/index.pdf resume.pdf
asciidoctor --base-dir ./ resume/index.adoc
{ set +x; } 2>/dev/null
}

# This loop was inspired by https://superuser.com/a/181543/774060
fswatch -x ./resume |
while read -r path events; do
if [ $(basename $path) = "resume.adoc" ]; then
echo "Detected fsevent:"
echo " $(basename $path) $events"
echo "Rendering resume:"
render_resume
fi
done
@@ -2,4 +2,4 @@
// from jekyll-specific conent in case I want to render it to other formats
// in the future.
:last-update-label!:
include::resume.adoc[]
include::./resume/resume.adoc[]

0 comments on commit 6b5b222

Please sign in to comment.