diff --git a/Rakefile b/Rakefile index 216dd38e07..950f1d3ced 100644 --- a/Rakefile +++ b/Rakefile @@ -27,18 +27,29 @@ end namespace :build do - desc "Build the Jekyll site (`en' language part only)" - task :en do + def build_subpage(lang) require "yaml" require "lanyon" exclude_config = YAML.load_file(CONFIG)["exclude"] - exclude_langs = (LANGUAGES - ["en"]).map {|lang| "#{lang}/" } + exclude_langs = (LANGUAGES - [lang]).map {|x| "#{x}/" } exclude = exclude_config + exclude_langs Lanyon.build(exclude: exclude) end + + desc "Build the Jekyll site (`lang' language part only)" + task :lang do + puts 'Please specify one of the valid language codes:' + puts LANGUAGES.join(', ') << '.' + end + + LANGUAGES.each do |lang| + task lang.to_sym do + build_subpage(lang) + end + end end desc "Serve the Jekyll site locally"