From 012a7d24bea114f32d1426f83df875c800328b0f Mon Sep 17 00:00:00 2001 From: wagurano Date: Sun, 22 Oct 2017 00:32:16 +0900 Subject: [PATCH] Add 'build:lang' task and Remove 'build:en' task Add a task that builds only one of the languages(bg de en es fr id it ja ko pl pt ru tr vi zh_cn zh_tw) --- Rakefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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"