From 425f87c609726ce0db6986216cded9cf209105a1 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 15 Sep 2023 22:06:39 +0100 Subject: [PATCH] Get env once --- hooks/tags.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hooks/tags.py b/hooks/tags.py index cc74067..6c9cb54 100644 --- a/hooks/tags.py +++ b/hooks/tags.py @@ -13,8 +13,10 @@ on_build_error = on_pre_build = on_post_build def on_files(files: Files, config): tags = set() - template = config["theme"].get_env().get_template("tag-template.md") - list_template = config["theme"].get_env().get_template("tag-list-template.md") + env = config["theme"].get_env() + + template = env.get_template("tag-template.md") + list_template = env.get_template("tag-list-template.md") for file in files.documentation_pages(): with open(file.abs_src_path) as f: