Skip to content

Commit 5768c3d

Browse files
waguranostomar
authored andcommitted
Provide a 'build' task for all languages (#1678)
Add tasks that build only one of the languages, similar to the already existing 'build:en' task.
1 parent 36db2ad commit 5768c3d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Rakefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,29 @@ end
2727

2828
namespace :build do
2929

30-
desc "Build the Jekyll site (`en' language part only)"
31-
task :en do
30+
def build_subpage(lang)
3231
require "yaml"
3332
require "lanyon"
3433

3534
exclude_config = YAML.load_file(CONFIG)["exclude"]
36-
exclude_langs = (LANGUAGES - ["en"]).map {|lang| "#{lang}/" }
35+
exclude_langs = (LANGUAGES - [lang]).map {|x| "#{x}/" }
3736

3837
exclude = exclude_config + exclude_langs
3938

4039
Lanyon.build(exclude: exclude)
4140
end
41+
42+
desc "Build the Jekyll site (`lang' language part only)"
43+
task :lang do
44+
puts 'Please specify one of the valid language codes:'
45+
puts LANGUAGES.join(', ') << '.'
46+
end
47+
48+
LANGUAGES.each do |lang|
49+
task lang.to_sym do
50+
build_subpage(lang)
51+
end
52+
end
4253
end
4354

4455
desc "Serve the Jekyll site locally"

0 commit comments

Comments
 (0)