I have tried GitHub pages to host my site, but I have found some problems and concerns with it that made me think it was better to use my own server.
Now I have a server with nginx that servers other sites and content.
I am looking for the best strategy, and thinking of two posible strategies.
I would like opinions on which is best and how to implement it.
1. Install Jekyll and GIT.
This approach would be the GitHub way but with your own server.
Install Jekyll in it and let it generate the online site from the sources each time a document is changed.
In order to update the documents and have complete versioning you need a git server in your online server.
Installing a Jekyll and a git servers does not seem complicate.
But I need guidance with some aspects:
Once installed Jekyll, how do I keep it running in order to recreate the site each time a source does change?
I suppose it is as easy as creating a “nohup Jekyll -build” to initd or something like that.
Should I redirect the output to a log file or it may get too big, and better sending it to /dev/null?
How to launch Jekyll again automatically if it crashes?
Once installed a git server, How do I create and upload the local git repository using atom?
How do I connect atom with the repository using a secure connection?
To publish the site online, I will direct nginx to the generated _site directory, I suppose it is the correct way of doing it, and it would detect and serve any change in generated files.
Any problems with caching or something like that?
2. Just upload the generated _site using a syncing tool
Another aproach, probably easier to use, would be to use a one way sync tool like rsync to upload to the server just the generated _site files, and serve them using nginx as a static file server.
The git version control would be used locally only.
The problem I see is that I loose the pull step, and any commit when I am testing changes would be uploaded to the server, but it would be simple to maintain.
And I would need another tool like rsync for the sync.