From 800b2527884b1a28a9d4c94a7f1c57251f4356c3 Mon Sep 17 00:00:00 2001 From: Midgard Date: Sat, 29 Feb 2020 00:47:15 +0100 Subject: [PATCH] Improve README and Makefile --- Makefile | 11 ++++++++++- README.md | 24 +++++++++++++----------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 24b9ad0..901db21 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,11 @@ +.PHONY: live build setup + +live: + bundle exec nanoc live + build: - nanoc + bundle exec nanoc + +setup: + which bundle || { { gem install bundler && which bundle; } || echo 'Could not find `bundle`.'" Make sure the directory with the Ruby's gem executables is in your PATH. (Typically ~/.gem/ruby/*/bin)" && false; } + bundle install diff --git a/README.md b/README.md index 11079c4..82d5795 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,24 @@ Durf Doen 2.0 ## Setup instructions -1. Install bundler (`gem install bundler`) -2. Install other gems (`bundle install`) -3. Build and serve the site (`bundle exec nanoc live`) +1. Install Ruby, preferably the version specified in `.ruby-version` +2. Install bundler (`gem install bundler`) +3. Install other dependencies (`bundle install`) +4. Build and serve the site (`bundle exec nanoc live`) + +To build the artefacts for production: `bundle exec nanoc` ### Setup on windows -This is very flacky, but it might help to -- Ofcourse only install ruby 2.6 -- change `gem 'mini_racer'` to `gem 'mini_racer', platforms: :ruby` in Gemfile -- following this github page https://github.com/eakmotion/therubyracer_for_windows -- Edit this file `C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\eventmachine-1.2.7-x64-mingw32\lib` by adding `require 'em pure_ruby'` and a newline to the top of the file. +This is very flaky, but it might help to +- Of course only install Ruby 2.6 +- Change `gem 'mini_racer'` to `gem 'mini_racer', platforms: :ruby` in Gemfile +- Follow this GitHub page https://github.com/eakmotion/therubyracer_for_windows +- Edit this file `C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\eventmachine-1.2.7-x64-mingw32\lib`, adding `require 'em pure_ruby'` and a newline to the top of the file - After all this, on my machine, it still throws an exception, but the live reloading works, until it doesn't (most of the time after a failed compile) +### Optional setup via Docker -### Optional setup via docker - -You can run the code in a separated docker environment. It compiles the code and serves the files via nginx. +You can run the code in a separated Docker environment. It compiles the code and serves the files via nginx. docker build --tag durfdoen2 . && docker run --publish 8080:80 --detach --name dd durfdoen2