This repository was archived by the owner on Jan 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathRakefile
More file actions
62 lines (52 loc) · 1.56 KB
/
Rakefile
File metadata and controls
62 lines (52 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# frozen_string_literal: true
require 'colorator'
require 'html-proofer'
# Require helper methods from the 'lib' directory
Dir.glob('lib/**/*.rb') { |file| require_relative(file) }
task default: %w[preview]
desc 'Preview the web site locally'
task preview: %w[install clean] do
puts 'Generating the web site locally ... '.magenta
if File.exist?('_config.local.yml')
print 'enabled the additional configuration parameters from _config.local.yml: $ '.magenta
sh 'bin/jekyll',
'serve',
'--incremental',
'--open-url',
'--livereload',
'--trace',
'--config=_config.yml,_config.local.yml',
'--plugins=_plugins,_checks'
else
Rake::Task['preview:all'].invoke
end
end
task :clean do
puts 'Cleaning after the last site generation...'.magenta
print 'Removing _site: $ '.yellow
sh 'rm', '-rf','_site'
print 'Running Jekyll cleaner: $ '.yellow
sh 'bin/jekyll', 'clean'
puts 'Clean!'.green
end
task :install do
print 'Install gems listed in the Gemfile: $ '.magenta
sh 'bundle install'
puts 'Installed!'.green
end
desc 'Build the website'
task build: %w[clean] do
print 'Building the site with Jekyll: $ '.magenta
sh 'bin/jekyll', 'build', '--verbose', '--trace'
puts 'Built!'.green
end
desc 'Run checks (image optimization and Markdown style linting).'
task check: %w[check:image_optim check:mdl]
desc "Same as 'test:report'"
task test: %w[test:links]
desc 'Generate index for Algolia'
task :index do
sh 'bin/jekyll',
'algolia',
'--config=_config.yml,_config.index.yml'
end