blurry-cli 0.7.1__tar.gz → 0.7.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.7.1 → blurry_cli-0.7.2}/PKG-INFO +1 -1
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/__init__.py +0 -1
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/markdown/__init__.py +10 -1
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/open_graph.py +1 -1
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/pyproject.toml +1 -1
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/LICENSE +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/README.md +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/__main__.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/async_typer.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/cli.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/constants.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/images.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/markdown/front_matter.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/markdown/renderer_functions/__init__.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/markdown/renderer_functions/render_video.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/__init__.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/html_plugins/__init__.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/__init__.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/py.typed +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/schema_validation.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/settings.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/sitemap.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/types.py +0 -0
- {blurry_cli-0.7.1 → blurry_cli-0.7.2}/blurry/utils.py +0 -0
|
@@ -69,15 +69,24 @@ class BlurryRenderer(mistune.HTMLRenderer):
|
|
|
69
69
|
attributes["src"] = src
|
|
70
70
|
|
|
71
71
|
if extension.lower() in SETTINGS.get("VIDEO_EXTENSIONS"):
|
|
72
|
-
return render_video(src, absolute_path, extension, title=
|
|
72
|
+
return render_video(src, absolute_path, extension, title=title)
|
|
73
73
|
|
|
74
74
|
# Tailor srcset and sizes to image width
|
|
75
75
|
with Image(filename=str(absolute_path)) as img:
|
|
76
76
|
image_width = img.width
|
|
77
77
|
image_height = img.height
|
|
78
|
+
# The .animated property doesn't always detect animated .webp images
|
|
79
|
+
# and .webp is optimized enough not to benefit much from .avif
|
|
80
|
+
image_is_animated = img.animation or extension.lower() == "webp"
|
|
78
81
|
attributes["width"] = image_width
|
|
79
82
|
attributes["height"] = image_height
|
|
80
83
|
|
|
84
|
+
if image_is_animated:
|
|
85
|
+
attributes_str = " ".join(
|
|
86
|
+
f'{name}="{value}"' for name, value in attributes.items()
|
|
87
|
+
)
|
|
88
|
+
return f"<img {attributes_str} >"
|
|
89
|
+
|
|
81
90
|
image_widths = get_widths_for_image_width(image_width)
|
|
82
91
|
|
|
83
92
|
attributes["sizes"] = generate_sizes_string(image_widths)
|
|
@@ -4,7 +4,7 @@ from typing import Literal
|
|
|
4
4
|
from blurry.types import SchemaType
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
META_TAG_TEMPLATE = '<meta property="og:{property}" content="{content}"
|
|
7
|
+
META_TAG_TEMPLATE = '<meta property="og:{property}" content="{content}">'
|
|
8
8
|
|
|
9
9
|
OpenGraphType = Literal["article", "book", "profile", "website"]
|
|
10
10
|
|
|
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
|
|
File without changes
|
|
File without changes
|