Module: Serve
Overview
Serve jekyll module
Constant Summary collapse
- JEKYLL_OPTIONS =
'--config _config-dev.yml --host 0.0.0.0'
Instance Method Summary collapse
Instance Method Details
#dev(collections) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/jekyll_theme_marketing/serve.rb', line 9 def dev(collections) puts "## Running: bundle exec jekyll serve #{JEKYLL_OPTIONS}" customize_config_file(collections) system "bundle exec jekyll serve #{JEKYLL_OPTIONS}" rescue Interrupt => e puts e puts "\n## Shutting down server" end |
#prod ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/jekyll_theme_marketing/serve.rb', line 18 def prod puts "## Running: bundle exec jekyll serve #{JEKYLL_OPTIONS}" config_prod = YAML.load_file('_config.yml') config_prod.merge!('baseurl' => nil) config_dev = File.new('_config-dev.yml', 'w') config_dev.write(config_prod.to_h.to_yaml) config_dev.close system "bundle exec jekyll serve #{JEKYLL_OPTIONS}" rescue Interrupt => e puts e puts "\n## Shutting down server" end |