commit d51e816e4f705ba70ce6fbdc497838f42045666d
parent a0377272d86a517d2de68cd11b0358967afb5cc9
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Fri, 4 Oct 2024 12:06:31 +0200
feat: show favicon of news-source as button
Diffstat:
2 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/run.sh b/run.sh
@@ -12,6 +12,10 @@ sed -E -e 's/<img[^>]*>//g' -e 's/<iframe[^>]*>//g' -i index.html
printf "Clean up HTML...\n"
sed -E -e 's/<br[^a-z]*[^>]*>//g' -e 's/<p[^a-z]*[^>]*><\/p>//g' -i index.html
+# insert favicon image buttons
+printf "Insert favicons...\n"
+sed -E -e 's/<!--IMG\ src=\"(https:\/\/[^\/]*)[^\"]*(\"[^>]*>)-->/<img src=\"\1\/favicon.ico\2/g' -i index.html
+
# Insert feeds list
printf "Inserting feeds list...\n"
FEEDS=`
diff --git a/template.html b/template.html
@@ -37,12 +37,25 @@
h2 > a[href^="https"]::after {
content: " \2197";
}
- /* Hide images and iframes in case they are not filtered out */
- img,
+ /* Hide iframes in case they are not filtered out */
iframe
{
display: none;
}
+ /* Rules for buttons row */
+ .button-row {
+ width: 100%;
+ display: flex;
+ }
+ .button-row > .button {
+ display: inline-flex;
+ margin-left: 5px;
+ margin-right: 5px;
+ }
+ img.button {
+ height: 30px;
+ width: auto;
+ }
</style>
</head>
@@ -94,16 +107,23 @@
[% entry.content.body %]
[% END %]
</p>
- [% IF entry.issued %]
- <stretch class="button">
- [% entry.issued | html %]
- </stretch>
- [% END %]
- [% IF entry.author %]
- <stretch class="button">
- [% entry.author | html %]
- </stretch>
- [% END %]
+
+ <div class="button-row">
+ <a class="button" href="[% entry.link | url | html %]">
+ <!--IMG src="[% entry.link | url | html %]">-->
+ </a>
+ [% IF entry.issued %]
+ <stretch class="button">
+ [% entry.issued | html %]
+ </stretch>
+ [% END %]
+ [% IF entry.author %]
+ <stretch class="button">
+ [% entry.author | html %]
+ </stretch>
+ [% END %]
+ </div>
+
</section>
[% END %]