Share LaTeX Document on Netlify
My dissertation is finally finished. Before finishing my dissertation, I was eager to share it with my classmates so that they could read and give me suggestions. Normally, I would give them read-only access on the Git or Subversion repository containing my dissertation, so that they can check out the LaTeX source files, and then compile the dissertation. This procedure creates a hurdle for them, because LaTeX is normally not installed on mobile devices they might use.
For most people, the solution would be sending PDF attachments. However, when I add more and more text and pictures into my dissertation, the PDF becomes increaseingly large, and I don't want to send large files and use up the quota of my and my classmates' mailboxes. There is a better solution.
Netlify is a free hosting service for static web sites. It provides a Node.js client app, which can deploy a prepared website from the command line. It can also pick up commits into a git repository, and compile the website from source code.
While my dissertation is not a website, hosting it on Netlify is totally feasible. Although Netlify's continuous deployment does not support LaTeX, I can still compile the PDF locally, and upload it to Netlify. To do so, I added a Makefile rule:
REVISION = `git rev-parse HEAD`
dissertation.pdf:
# normal build steps
upload: dissertation.pdf
rm -f www/*.pdf
cp dissertation.pdf www/$(REVISION).pdf
echo '<!doctype html><title>paper</title><h1>Named Data Networking in Local Area Networks dissertation</h1><a href="'$(REVISION)'.pdf">revision '$(REVISION)'</a>' > www/index.html
netlify deploy -t ndn-lan-thesis -p www