Skip to content

Commit 04d4104

Browse files
committed
Add 'build:en' task
Add a task that only builds the 'en' part of the site (with much reduced build time), for faster previewing of layout changes, new features or content, etc.
1 parent 8042d57 commit 04d4104

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Rakefile

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ end
1212

1313
HOST = 'www.ruby-lang.org'
1414
LANGUAGES = %w[bg de en es fr id it ja ko pl pt ru tr vi zh_cn zh_tw]
15+
CONFIG = "_config.yml"
1516

1617
task :default => [:build]
1718

@@ -22,6 +23,22 @@ task :build do
2223
Lanyon.build
2324
end
2425

26+
namespace :build do
27+
28+
desc "Build the Jekyll site (`en' language part only)"
29+
task :en do
30+
require "yaml"
31+
require "lanyon"
32+
33+
exclude_config = YAML.load_file(CONFIG)["exclude"]
34+
exclude_langs = (LANGUAGES - ["en"]).map {|lang| "#{lang}/" }
35+
36+
exclude = exclude_config + exclude_langs
37+
38+
Lanyon.build(exclude: exclude)
39+
end
40+
end
41+
2542
desc "Serve the Jekyll site locally"
2643
task :serve do
2744
sh "rackup config.ru"

0 commit comments

Comments
 (0)