diff --git a/.gitignore b/.gitignore index 35d177e..e037a6d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .DS_Store .sass-cache build/ -crowdin.yml +trans/ +locale/ diff --git a/Gemfile b/Gemfile index d706f1d..4bb53ed 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,4 @@ gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby] gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw] gem 'redcarpet' gem 'middleman-syntax' +gem 'rake' diff --git a/Gemfile.lock b/Gemfile.lock index f18f246..d4994ae 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,7 @@ GEM fast_blank (1.0.0) fastimage (2.2.0) ffi (1.13.1) - haml (5.2.0) + haml (5.2.1) temple (>= 0.8.0) tilt hamster (3.0.0) @@ -84,6 +84,7 @@ GEM parallel (1.20.1) public_suffix (4.0.6) rack (2.2.3) + rake (13.0.1) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) @@ -109,6 +110,7 @@ DEPENDENCIES middleman (~> 4.2) middleman-autoprefixer (~> 2.7) middleman-syntax + rake redcarpet tzinfo-data wdm (~> 0.1) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..07f522b --- /dev/null +++ b/Rakefile @@ -0,0 +1,41 @@ +require "pathname" + +BUILD_DIR = "build" +TRANS_DIR = "trans" +LOCALE_DIR = "locale" + +task :default => [:build_trans, "crowdin:upload", :build_site] + +desc "Build site" +multitask :build_site => [:build_base, "crowdin:download"] do + Pathname.glob("#{LOCALE_DIR}/**/*.html").select(&:file?).each do |path| + content = path.read + content.sub! /