Skip to content

Commit 631a8f6

Browse files
committed
web setup
1 parent 86b356f commit 631a8f6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

build.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def load_remote_partial(repo, name, locale)
2121
end
2222

2323
def load_local_partial(name, locale)
24-
path = locale == 'en' ? "_partials/#{name}.md" : "_partials/#{locale}/#{name}.md"
24+
localized = "_partials/#{locale}/#{name}.md"
25+
path = (locale != 'en' && File.exist?(localized)) ? localized : "_partials/#{name}.md"
2526
File.read(path, encoding: "utf-8")
2627
end
2728

@@ -58,7 +59,7 @@ def generate_files(loaded, builds, constants)
5859
File.open(output, "w:utf-8") do |f|
5960
build[:partials].each do |entry|
6061
content = loaded["#{partial_name(entry)}.#{locale}"].clone
61-
variables = constants.merge(partial_vars(entry))
62+
variables = constants.merge(partial_vars(entry)).merge('build_md' => output)
6263
f << render_content(content, build[:os], variables)
6364
f << "\n\n"
6465
end

0 commit comments

Comments
 (0)