blurry-cli 0.19.0__tar.gz → 0.19.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/PKG-INFO +5 -1
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/README.md +4 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/markdown/__init__.py +19 -7
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/pyproject.toml +1 -1
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/LICENSE +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/__main__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/async_typer.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/cli.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/commands/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/commands/clean.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/commands/init.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/commands/version.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/constants.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/file_processors/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/gather_file_data_by_directory.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/images.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/markdown/front_matter.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/markdown/renderer_functions/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/markdown/renderer_functions/render_video.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/open_graph.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/html_plugins/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/jinja_plugins/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/jinja_plugins/blurry_image_extension.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/jinja_plugins/filters.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/py.typed +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/runserver_handlers.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/schema_validation/__init__.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/schema_validation/models.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/settings.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/sitemap.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/templates.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/types.py +0 -0
- {blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blurry-cli
|
|
3
|
-
Version: 0.19.
|
|
3
|
+
Version: 0.19.2
|
|
4
4
|
Summary: A Mistune-based static site generator for Python
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -86,3 +86,7 @@ Blurry blends together high-quality libraries:
|
|
|
86
86
|
|
|
87
87
|
© 2020-present, John Franey
|
|
88
88
|
|
|
89
|
+
## Star History
|
|
90
|
+
|
|
91
|
+
[](https://www.star-history.com/#blurry-dev/blurry&type=date&legend=top-left)
|
|
92
|
+
|
|
@@ -45,3 +45,7 @@ Blurry blends together high-quality libraries:
|
|
|
45
45
|
- [ImageMagick](https://imagemagick.org/index.php) to resize and convert images
|
|
46
46
|
|
|
47
47
|
© 2020-present, John Franey
|
|
48
|
+
|
|
49
|
+
## Star History
|
|
50
|
+
|
|
51
|
+
[](https://www.star-history.com/#blurry-dev/blurry&type=date&legend=top-left)
|
|
@@ -73,6 +73,19 @@ class BlurryRenderer(mistune.HTMLRenderer):
|
|
|
73
73
|
if extension.lower() in SETTINGS.get("VIDEO_EXTENSIONS"):
|
|
74
74
|
return render_video(src, absolute_path, extension, title=title)
|
|
75
75
|
|
|
76
|
+
if extension.lower() == "svg":
|
|
77
|
+
import xml.etree.ElementTree as ET
|
|
78
|
+
|
|
79
|
+
svg_element = ET.parse(absolute_path).getroot()
|
|
80
|
+
if width := svg_element.get("width"):
|
|
81
|
+
attributes["width"] = width
|
|
82
|
+
if height := svg_element.get("height"):
|
|
83
|
+
attributes["height"] = height
|
|
84
|
+
attributes_str = " ".join(
|
|
85
|
+
f'{name}="{value}"' for name, value in attributes.items()
|
|
86
|
+
)
|
|
87
|
+
return f"<img {attributes_str}>"
|
|
88
|
+
|
|
76
89
|
# Tailor srcset and sizes to image width
|
|
77
90
|
with Image.open(absolute_path) as img:
|
|
78
91
|
image_width, image_height = img.size
|
|
@@ -80,7 +93,7 @@ class BlurryRenderer(mistune.HTMLRenderer):
|
|
|
80
93
|
attributes["width"] = str(image_width)
|
|
81
94
|
attributes["height"] = str(image_height)
|
|
82
95
|
|
|
83
|
-
if image_is_animated
|
|
96
|
+
if image_is_animated:
|
|
84
97
|
attributes_str = " ".join(
|
|
85
98
|
f'{name}="{value}"' for name, value in attributes.items()
|
|
86
99
|
)
|
|
@@ -89,12 +102,11 @@ class BlurryRenderer(mistune.HTMLRenderer):
|
|
|
89
102
|
image_widths = get_widths_for_image_width(image_width)
|
|
90
103
|
|
|
91
104
|
sizes = generate_sizes_string(image_widths)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
105
|
+
# Use AVIF for all remaining images, except WEBP
|
|
106
|
+
new_extension = "webp" if src.endswith(".webp") else "avif"
|
|
107
|
+
src = src.replace(extension, "avif") if new_extension != "webp" else src
|
|
108
|
+
srcset = generate_srcset_string(src, image_widths)
|
|
109
|
+
source_tag = f'<source srcset="{srcset}" sizes="{sizes}" type="image/{new_extension}" />'
|
|
98
110
|
|
|
99
111
|
attributes_str = " ".join(
|
|
100
112
|
f'{name}="{value}"' for name, value in attributes.items()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/jinja_plugins/blurry_image_extension.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/punctuation_plugin.py
RENAMED
|
File without changes
|
{blurry_cli-0.19.0 → blurry_cli-0.19.2}/blurry/plugins/markdown_plugins/python_code_plugin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|