Index: cms/bin/generate_static_pages.py |
=================================================================== |
--- a/cms/bin/generate_static_pages.py |
+++ b/cms/bin/generate_static_pages.py |
@@ -57,20 +57,22 @@ def generate_pages(repo, output_dir): |
# Cache the result for some functions - we can assume here that the data |
# never changes |
source.resolve_link = memoize(source.resolve_link) |
source.read_config = memoize(source.read_config) |
source.read_template = memoize(source.read_template) |
source.read_locale = memoize(source.read_locale) |
source.read_include = memoize(source.read_include) |
+ config = source.read_config() |
+ defaultlocale = config.get("general", "defaultlocale") |
locales = list(source.list_locales()) |
for page, format in source.list_pages(): |
for locale in locales: |
- if source.has_locale(locale, page): |
+ if locale == defaultlocale or source.has_locale(locale, page): |
pagedata = process_page(source, locale, page, format) |
# Make sure links to static files are versioned |
pagedata = re.sub(r'(<script\s[^<>]*\bsrc="/[^"<>]+)', r"\1?%s" % source.version, pagedata) |
pagedata = re.sub(r'(<link\s[^<>]*\bhref="/[^"<>]+)', r"\1?%s" % source.version, pagedata) |
pagedata = re.sub(r'(<img\s[^<>]*\bsrc="/[^"<>]+)', r"\1?%s" % source.version, pagedata) |
write_file([locale] + page.split("/"), pagedata) |