~mrls/www

ref: a4d4755175d63e4aee640f0d6d6c68ba269738b0 www/Rakefile -rw-r--r-- 624 bytes View raw
a4d47551Mauro Morales Resize images a month ago
                                                                                
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
# frozen_string_literal: true

require 'html-proofer'

desc 'Build the site'
task :build do
  sh 'jekyll', 'build'
end

desc 'Run the tests'
task :test do
  Rake::Task[:build].execute
  options = {
    assume_extension: true,
    cache: { timeframe: '30d' }

  }
  HTMLProofer.check_directory('./_site', options).run
end

desc 'Deploy'
task :deploy do
  Rake::Task[:test].execute
  sh "rsync -avz --delete _site/* #{ENV['DEST']}"
end

desc 'Resize Images'
task :resize, [:dir] do |_task, args|
  images = Dir.glob(File.join(args[:dir], '*'))
  images.each do |image|
    sh "convert #{image} -resize 800 #{image}"
  end
end