@@ -6,11 +6,6 @@ require 'dotenv/load'
6
6
JEKYLL_BASENAME = ENV [ 'JEKYLL_BASENAME' ] || 'docs'
7
7
HTML_PROOFER_PARALLEL = ENV [ 'HTML_PROOFER_PARALLEL' ] || 4
8
8
9
- desc 'Shim untranslated Japanese pages'
10
- task :shim_untranslated do
11
- sh './scripts/shim-translation.sh jekyll/_cci2 jekyll/_cci2_ja'
12
- end
13
-
14
9
desc 'Build Jekyll site'
15
10
task :build do
16
11
# Build the Jekyll site
@@ -35,34 +30,34 @@ task :make_mock_api do
35
30
end
36
31
37
32
desc 'Build your jekyll site in local env'
38
- task :build_local => [ :shim_untranslated , : build, :make_mock_api ] do
33
+ task :build_local => [ :build , :make_mock_api ] do
39
34
puts 'Finish building your jekyll site, and now you can run `bundle exec rake test` to run `HTMLproofer` test'
40
35
end
41
36
42
37
desc 'Test with HTMLproofer'
43
38
task :test do
39
+
44
40
def makeFilePath ( target_dir )
45
41
return "./jekyll/_site/#{ JEKYLL_BASENAME } /#{ target_dir } /index.html"
46
42
end
47
43
48
44
ignore_dirs = [
49
45
"api/v2" ,
50
- "ja/2.0/runner-installation" ,
51
- "ja/2.0/security-server" ,
52
- "ja/2.0/v.2.19-overview" ,
53
- "ja/2.0/customizations" ,
54
- "ja/2.0/aws-prereq" ,
55
- "ja/2.0/ops" ,
56
- "ja/2.0/about-circleci" ,
57
- "ja/2.0/demo-apps" ,
58
- "ja/2.0/google-auth" ,
59
- "ja/2.0/orb-concepts" ,
60
- "ja/2.0/tutorials" ,
61
46
"reference-2-1"
62
47
]
63
48
64
49
ignore_files = ignore_dirs . map { |d | makeFilePath ( d ) }
65
- options = { :allow_hash_href => true , :check_favicon => false , :check_html => true , :disable_external => true , :empty_alt_ignore => true , :parallel => { :in_processes => HTML_PROOFER_PARALLEL } , :file_ignore => ignore_files }
50
+ ignore_ja_files = Dir . glob ( "./jekyll/_site/#{ JEKYLL_BASENAME } /ja/**/*" ) . select { |e | File . file? e } ;
51
+
52
+ options = {
53
+ :allow_hash_href => true ,
54
+ :check_favicon => false ,
55
+ :check_html => true ,
56
+ :disable_external => true ,
57
+ :empty_alt_ignore => true ,
58
+ :parallel => { :in_processes => HTML_PROOFER_PARALLEL } ,
59
+ :file_ignore => ignore_files . concat ( ignore_ja_files ) ,
60
+ }
66
61
67
62
HTMLProofer . check_directory ( "./jekyll/_site" , options ) . run
68
63
end
0 commit comments