diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-01-22 11:51:22 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-01-22 11:51:24 -0800 |
commit | 1d2d558f186267b5263f8224cdf8c94e48d9e7ea (patch) | |
tree | 98218abb8eb04a1ac58c83396cca84bb06d0e9a0 | |
parent | 32f28fc380f3149ecbb5ddf433d82e378645b406 (diff) | |
download | fatcat-scholar-1d2d558f186267b5263f8224cdf8c94e48d9e7ea.tar.gz fatcat-scholar-1d2d558f186267b5263f8224cdf8c94e48d9e7ea.zip |
jinja2: attempt to enable trans trimming by default
Not sure this is actually working
-rw-r--r-- | fatcat_scholar/web.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index 133ddce..010ad0d 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -158,6 +158,8 @@ def load_i18n_templates() -> Any: # remove a lot of whitespace in HTML output with these configs templates.env.trim_blocks = True templates.env.lstrip_blocks = True + # have {% trans %} blocks trim whitespace by default + templates.env.policies['ext.i18n.trimmed'] = True # pass-through application settings to be available in templates templates.env.globals["settings"] = settings d[lang_opt] = templates |