Skip to content

Commit

Permalink
Fully automate resume render process
Browse files Browse the repository at this point in the history
  • Loading branch information
relaxdiego committed Sep 23, 2017
1 parent ffebc53 commit 6b5b222
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Procfile
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,4 @@
# Run this using Foreman via `foreman start`
# See: https://github.com/ddollar/foreman
web: jekyll server start
resume: ./render-resume
2 changes: 0 additions & 2 deletions _config.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ enforce_ssl: www.relaxdiego.com
permalink: /:year/:month/:title.html permalink: /:year/:month/:title.html
highlighter: rouge highlighter: rouge
markdown: kramdown markdown: kramdown
gems:
- jekyll-asciidoc
25 changes: 22 additions & 3 deletions render-resume
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/usr/bin/env bash #!/usr/bin/env bash
asciidoctor-pdf resume/index.adoc
mv resume/index.pdf resume.pdf # Requires fswatch https://github.com/emcrisostomo/fswatch
asciidoctor resume/index.adoc # `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 changes: 1 addition & 1 deletion resume/index.adoc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// from jekyll-specific conent in case I want to render it to other formats // from jekyll-specific conent in case I want to render it to other formats
// in the future. // in the future.
:last-update-label!: :last-update-label!:
include::resume.adoc[] include::./resume/resume.adoc[]

0 comments on commit 6b5b222

Please sign in to comment.