forked from megane9988/yasslab.jp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
56 lines (50 loc) · 1.44 KB
/
Rakefile
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
require "bundler/setup"
#require "jekyll/task/i18n"
task default: 'assets:precompile'
namespace :assets do
task :precompile do
Rake::Task['clean'].invoke
sh 'JEKYLL_ENV=production bundle exec jekyll build'
end
end
# cf. How to test a Jekyll site
# http://joenyland.me/blog/how_to_test_a_jekyll_site/
require 'html-proofer'
task test: [:build] do
sh "bundle exec rake assets:precompile" unless ENV['SKIP_BUILD'] == '1'
options = {
allow_hash_href: true,
check_opengraph: true,
check_favicon: true,
check_html: true,
disable_external: true,
file_ignore: [
/node_modules/,
"./_site/ja/workshops/raspi/index.html",
"./_site/en/workshops/raspi/index.html",
"./_site/ja/workshops/tickle/index.html",
"./_site/google02f5cc9ed3681f94.html"
],
url_ignore: %w(coderdojo.com linkedin.com),
http_status_ignore: [0, 500, 999],
}
HTMLProofer.check_directory('./_site', options).run
end
task build: [:clean] do
system 'bundle exec jekyll build'
end
task :clean do
system 'bundle exec jekyll clean'
end
#Jekyll::Task::I18n.define do |task|
# task.locales = ["ja"]
# task.translator_name = "Yohei Yasukawa"
# task.translator_email = "[email protected]"
# task.files = Rake::FileList["**/*.md"]
# task.files -= Rake::FileList["_*/**/*.md"]
# task.locales.each do |locale|
# task.files -= Rake::FileList["#{locale}/**/*.md"]
# end
#end
#
#task default: "jekyll:i18n:translate"