Skip to content

Commit

Permalink
refactor: copy global values in Jinja context
Browse files Browse the repository at this point in the history
Copies global values in Jinja context so they aren't modified in Jinja template
variable operations, like sorted()
  • Loading branch information
johnfraney committed Feb 4, 2024
1 parent 7c5c039 commit eb2a89f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blurry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import shutil
from collections.abc import Coroutine
from copy import deepcopy
from datetime import datetime
from mimetypes import guess_type
from mimetypes import types_map
Expand Down Expand Up @@ -142,11 +143,11 @@ async def write_html_file(
"open_graph_tags": open_graph_meta_tags(file_data.front_matter),
"build_path": folder_in_build,
"file_data_by_directory": {
str(path): data for path, data in file_data_by_directory.items()
str(path): data for path, data in deepcopy(file_data_by_directory).items()
},
"settings": SETTINGS,
"settings": deepcopy(SETTINGS),
**schema_variables,
**extra_context,
**deepcopy(extra_context),
**template_context,
}

Expand Down

0 comments on commit eb2a89f

Please sign in to comment.