mirror of
https://github.com/tanrax/RSSPAPER.git
synced 2025-04-21 19:24:13 -04:00
Update image
This commit is contained in:
parent
e34e09eccd
commit
43439c4ed9
@ -193,6 +193,18 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.article__header-img > img {
|
||||||
|
height: 12rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed__article:nth-child(1) .article__header-img > img,
|
||||||
|
.feed__article:nth-child(2) .article__header-img > img,
|
||||||
|
.feed__article:nth-child(3) .article__header-img > img,
|
||||||
|
.feed__article:nth-child(4) .article__header-img > img
|
||||||
|
{
|
||||||
|
height: initial;
|
||||||
|
}
|
||||||
|
|
||||||
.feed__article:nth-child(2) .article__titles,
|
.feed__article:nth-child(2) .article__titles,
|
||||||
.feed__article:nth-child(3) .article__titles,
|
.feed__article:nth-child(3) .article__titles,
|
||||||
.feed__article:nth-child(4) .article__titles,
|
.feed__article:nth-child(4) .article__titles,
|
||||||
@ -243,7 +255,7 @@
|
|||||||
<header class="article__header">
|
<header class="article__header">
|
||||||
{% if article.cover %}
|
{% if article.cover %}
|
||||||
<p class="article__header-img">
|
<p class="article__header-img">
|
||||||
<img src="{{ article.cover }}" alt="{{ article.title }}">
|
<img loading="lazy" src="{{ article.cover }}" alt="{{ article.title }}">
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="article__titles">
|
<div class="article__titles">
|
||||||
|
@ -32,7 +32,8 @@
|
|||||||
;; Add cover to article search first image in description
|
;; Add cover to article search first image in description
|
||||||
;; Iterate every blog
|
;; Iterate every blog
|
||||||
(map (fn [article]
|
(map (fn [article]
|
||||||
(assoc article :cover (second (re-find #"<img[^>]+src=\"([^\">]+)\"" (str (get-in article [:description :value])))))
|
(let [url-article (second (re-find #"<img[^>]+src=\"([^\">]+)\"" (str (get-in article [:description :value]))))]
|
||||||
|
(assoc article :cover (if (nil? url-article) (get-in article [:feed :image :url]) url-article)))
|
||||||
) articles))
|
) articles))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user