diff --git a/media/newsreader-banner.png b/media/newsreader-banner.png index 9a3f384..9784ec2 100644 Binary files a/media/newsreader-banner.png and b/media/newsreader-banner.png differ diff --git a/media/newsreader-banner.xcf b/media/newsreader-banner.xcf index 697eb3c..d70048d 100644 Binary files a/media/newsreader-banner.xcf and b/media/newsreader-banner.xcf differ diff --git a/media/newsreader-icon.xcf b/media/newsreader-icon.xcf index 8f06b3c..c7a8b5c 100644 Binary files a/media/newsreader-icon.xcf and b/media/newsreader-icon.xcf differ diff --git a/media/newsreader-logo.png b/media/newsreader-logo.png index c0dce10..e4b950c 100644 Binary files a/media/newsreader-logo.png and b/media/newsreader-logo.png differ diff --git a/media/newsreader-logo.xcf b/media/newsreader-logo.xcf index 435caaf..b71033d 100644 Binary files a/media/newsreader-logo.xcf and b/media/newsreader-logo.xcf differ diff --git a/media/newsreader-not-cover.png b/media/newsreader-not-cover.png new file mode 100644 index 0000000..1a40e7c Binary files /dev/null and b/media/newsreader-not-cover.png differ diff --git a/media/newsreader-not-cover.xcf b/media/newsreader-not-cover.xcf new file mode 100644 index 0000000..c194fe8 Binary files /dev/null and b/media/newsreader-not-cover.xcf differ diff --git a/resources/themes/light/index.html b/resources/themes/light/index.html index 16a1cec..71280d0 100644 --- a/resources/themes/light/index.html +++ b/resources/themes/light/index.html @@ -44,7 +44,7 @@ {% if article.cover %} {{ article.title }} {% else %} - + Not cover {% endif %}

diff --git a/resources/themes/light/static.zip b/resources/themes/light/static.zip index 3801690..79b41b7 100644 Binary files a/resources/themes/light/static.zip and b/resources/themes/light/static.zip differ diff --git a/resources/themes/light/static/css/main.css b/resources/themes/light/static/css/main.css index f8bf83b..82dbb4d 100644 --- a/resources/themes/light/static/css/main.css +++ b/resources/themes/light/static/css/main.css @@ -85,8 +85,8 @@ pre { .article__header-img > a > img { height: var(--height-img); - object-position: center; - object-fit: contain; + object-position: top; + object-fit: cover; } .article__random-background { height: 100%; diff --git a/resources/themes/light/static/css/mobile.css b/resources/themes/light/static/css/mobile.css index afb941a..db42972 100644 --- a/resources/themes/light/static/css/mobile.css +++ b/resources/themes/light/static/css/mobile.css @@ -4,4 +4,10 @@ .subtitle { font-size: 1rem; +} + +.article__header-img > a > img { + height: initial; + object-position: initial; + object-fit: initial; } \ No newline at end of file diff --git a/resources/themes/light/static/img/icons/apple-icon-180.png b/resources/themes/light/static/img/icons/apple-icon-180.png index 2ea93e9..74f6cb3 100644 Binary files a/resources/themes/light/static/img/icons/apple-icon-180.png and b/resources/themes/light/static/img/icons/apple-icon-180.png differ diff --git a/resources/themes/light/static/img/icons/favicon.png b/resources/themes/light/static/img/icons/favicon.png index 0eca42b..aaa29b1 100644 Binary files a/resources/themes/light/static/img/icons/favicon.png and b/resources/themes/light/static/img/icons/favicon.png differ diff --git a/resources/themes/light/static/img/icons/manifest-icon-192.png b/resources/themes/light/static/img/icons/manifest-icon-192.png index 9d47ec2..59d3d95 100644 Binary files a/resources/themes/light/static/img/icons/manifest-icon-192.png and b/resources/themes/light/static/img/icons/manifest-icon-192.png differ diff --git a/resources/themes/light/static/img/icons/manifest-icon-512.png b/resources/themes/light/static/img/icons/manifest-icon-512.png index 0e72b02..7882818 100644 Binary files a/resources/themes/light/static/img/icons/manifest-icon-512.png and b/resources/themes/light/static/img/icons/manifest-icon-512.png differ diff --git a/resources/themes/light/static/img/newsreader-not-cover.png b/resources/themes/light/static/img/newsreader-not-cover.png new file mode 100644 index 0000000..1a40e7c Binary files /dev/null and b/resources/themes/light/static/img/newsreader-not-cover.png differ diff --git a/src/rsspaper/feeds.clj b/src/rsspaper/feeds.clj index 152deab..e66ffe2 100644 --- a/src/rsspaper/feeds.clj +++ b/src/rsspaper/feeds.clj @@ -40,10 +40,13 @@ ;; Add cover to article search first image in description ;; Iterate every blog (map (fn [article] - (let [url-article (get-in article [:feed :link]) + ; User feedback + (prn (str "Looking for cover image for article > " (:link article))) + ; Search cover image + (let [url-article (:link article) html (:body (client/get url-article {:insecure? true})) url-og-image (second (re-find #"].*?property=\"og:image(?::url)?\".*?content=\"(.*?)\".*?>|].*?content=\"(.*?)\".*?property=\"og:image(?::url)?\".*?>" html)) - url-first-image (second (re-find #"[\s\S]*]+src=\"([^\"\'|>]+)\"|id=[\'\"] ?main ?[\'\"]>[\s\S]*]+src=\"([^\"\'|>]+)\"|class=[\'\"] ?main ?[\'\"]>[\s\S]*]+src=\"([^\"\'|>]+)\"" html)) + url-first-image (second (re-find #"[\s\S]+]+src=\"([^\">]+)\"|id=['\"] ?main ?['\"]>[\s\S]+]+src=\"([^\">]+)\"|class=['\"] ?main ?[\'\"]>[\s\S]+]+src=\"([^\">]+)\"" html)) images [url-og-image url-first-image] url-final-image (first (filter (fn [item] (not (nil? item))) images))] (assoc article :cover url-final-image))) articles)) @@ -61,6 +64,8 @@ (fn [feeds feed-url] ; Read feed (let [feed (parse-url feed-url {:insecure? true :throw-exceptions false})] + ; User feedback + (prn (str "Reading RSS > " feed-url)) ; Check is not null (if-not (nil? feed) ; Add feed