blurry-cli 0.7.0__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.
Files changed (28) hide show
  1. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/PKG-INFO +2 -1
  2. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/__init__.py +0 -1
  3. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/markdown/__init__.py +10 -1
  4. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/open_graph.py +1 -1
  5. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/sitemap.py +8 -4
  6. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/pyproject.toml +2 -1
  7. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/LICENSE +0 -0
  8. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/README.md +0 -0
  9. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/__main__.py +0 -0
  10. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/async_typer.py +0 -0
  11. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/cli.py +0 -0
  12. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/constants.py +0 -0
  13. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/images.py +0 -0
  14. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/markdown/front_matter.py +0 -0
  15. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/markdown/renderer_functions/__init__.py +0 -0
  16. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/markdown/renderer_functions/render_video.py +0 -0
  17. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/__init__.py +0 -0
  18. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/html_plugins/__init__.py +0 -0
  19. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/html_plugins/minify_html_plugin.py +0 -0
  20. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/__init__.py +0 -0
  21. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/container_plugin.py +0 -0
  22. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/punctuation_plugin.py +0 -0
  23. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/plugins/markdown_plugins/python_code_plugin.py +0 -0
  24. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/py.typed +0 -0
  25. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/schema_validation.py +0 -0
  26. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/settings.py +0 -0
  27. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/types.py +0 -0
  28. {blurry_cli-0.7.0 → blurry_cli-0.7.2}/blurry/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blurry-cli
3
- Version: 0.7.0
3
+ Version: 0.7.2
4
4
  Summary: A Mistune-based static site generator for Python
5
5
  Home-page: https://github.com/blurry-dev/blurry
6
6
  License: MIT
@@ -23,6 +23,7 @@ Classifier: Topic :: Text Processing :: Markup :: Markdown
23
23
  Requires-Dist: Jinja2 (>=3.0.0,<4.0.0)
24
24
  Requires-Dist: PyLD (>=2.0.3,<3.0.0)
25
25
  Requires-Dist: Wand (>=0.6.6,<0.7.0)
26
+ Requires-Dist: dpath (>=2.1.6,<3.0.0)
26
27
  Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0)
27
28
  Requires-Dist: htmlmin2 (>=0.1.13,<0.2.0)
28
29
  Requires-Dist: livereload (>=2.6.3,<3.0.0)
@@ -96,7 +96,6 @@ async def process_non_markdown_file(filepath: Path):
96
96
  if mimetype in [
97
97
  mimetypes.types_map[".jpg"],
98
98
  mimetypes.types_map[".png"],
99
- mimetypes.common_types[".webp"],
100
99
  ]:
101
100
  await generate_images_for_srcset(filepath)
102
101
 
@@ -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=text)
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
 
@@ -1,5 +1,7 @@
1
1
  from pathlib import Path
2
2
 
3
+ import dpath
4
+
3
5
  from blurry.settings import get_build_directory
4
6
  from blurry.types import MarkdownFileData
5
7
 
@@ -20,10 +22,12 @@ URL_TEMPLATE = " <url><loc>{url}</loc>{lastmod_tag}</url>"
20
22
  def generate_sitemap_for_file_data_list(file_data_list: list[MarkdownFileData]) -> str:
21
23
  sitemap_url_data = []
22
24
  for file_data in file_data_list:
23
- lastmod = file_data.front_matter.get(
24
- "dateModified"
25
- ) or file_data.front_matter.get("datePublished")
26
- lastmod_tag = f"<lastmod>{lastmod}</lastmod>" if lastmod else ""
25
+ lastmod = (
26
+ dpath.values(file_data.front_matter, "**/dateModified")
27
+ or dpath.values(file_data.front_matter, "**/datePublished")
28
+ or dpath.values(file_data.front_matter, "**/dateCreated")
29
+ )
30
+ lastmod_tag = f"<lastmod>{lastmod[0]}</lastmod>" if len(lastmod) else ""
27
31
  url = file_data.front_matter.get("url")
28
32
  sitemap_url_data.append({"lastmod_tag": lastmod_tag, "url": url})
29
33
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "blurry-cli"
3
- version = "0.7.0"
3
+ version = "0.7.2"
4
4
  description = "A Mistune-based static site generator for Python"
5
5
  authors = ["John Franey <franey@duck.com>"]
6
6
  license = "MIT"
@@ -36,6 +36,7 @@ toml = "^0.10.2"
36
36
  typer = "^0.6.1"
37
37
  htmlmin2 = "^0.1.13"
38
38
  pydantic2-schemaorg = "^0.1.1"
39
+ dpath = "^2.1.6"
39
40
 
40
41
  [tool.poetry.scripts]
41
42
  blurry = 'blurry:main'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes