core-maugli 1.2.24 → 1.2.25

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.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "core-maugli",
3
3
  "description": "Astro & Tailwind CSS blog theme for Maugli.",
4
4
  "type": "module",
5
- "version": "1.2.24",
5
+ "version": "1.2.25",
6
6
  "license": "GPL-3.0-or-later OR Commercial",
7
7
  "repository": {
8
8
  "type": "git",
@@ -20,10 +20,20 @@ const { href, title, image, seo, publishDate, excerpt, description, headingLevel
20
20
 
21
21
  const TitleTag = headingLevel;
22
22
 
23
+ // Отладка: проверяем, что именно приходит в image
24
+ console.log('Card.astro DEBUG:', {
25
+ type: typeof image,
26
+ value: image,
27
+ src: image?.src,
28
+ isObject: typeof image === 'object',
29
+ isString: typeof image === 'string'
30
+ });
31
+
23
32
  // Определяем базовое изображение для карточки
24
- const baseImage =
33
+ // Убеждаемся, что получаем только строку пути, а не объект asset
34
+ let baseImage =
25
35
  seo?.image?.src ||
26
- (image && typeof image.src === 'string' && image.src.length > 0 ? image.src : undefined) ||
36
+ (image && typeof image === 'object' && image.src ? image.src : image && typeof image === 'string' ? image : undefined) ||
27
37
  (type === 'blog'
28
38
  ? maugliConfig.defaultBlogImage
29
39
  : type === 'project'
@@ -32,7 +42,19 @@ const baseImage =
32
42
  ? maugliConfig.defaultProductImage
33
43
  : maugliConfig.seo.defaultImage);
34
44
 
35
- const cardImageAlt = seo?.image?.alt || image?.alt || title || 'Изображение';
45
+ // Убеждаемся, что baseImage - это строка, а не asset объект
46
+ if (baseImage && typeof baseImage === 'object' && baseImage.src) {
47
+ baseImage = baseImage.src;
48
+ }
49
+
50
+ // Убираем ведущий слэш, чтобы избежать обработки через asset pipeline
51
+ if (baseImage && baseImage.startsWith('/')) {
52
+ baseImage = baseImage.substring(1);
53
+ }
54
+
55
+ console.log('Card.astro baseImage:', baseImage);
56
+
57
+ const cardImageAlt = seo?.image?.alt || (image && typeof image === 'object' ? image.alt : undefined) || title || 'Изображение';
36
58
 
37
59
  // Определяем контент для отображения
38
60
  const content = excerpt || description;