pub / newsplanet

Planet-Style Newsfeed generated with perlanet
git clone https://src.jayvii.de/pub/newsplanet.git
Home | Log | Files | Exports | Refs | README | RSS

commit 170ab29aca28ddeebd466a44e907f8583e7006a9
parent cc5cfb85ff60262aae3ff662e86ef370deeb8953
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 20 Dec 2024 09:01:40 +0100

fix: only show domain name rather than sub-domain

Diffstat:
Mfetch_favicon.sh | 3++-
Mrun.sh | 4+++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fetch_favicon.sh b/fetch_favicon.sh @@ -12,7 +12,8 @@ URLS=`grep -E "^\s*-*\ web:" "$CONFIG" | sed -e 's/^.*web:\ //g'` # get domains DOMAINS=` - echo "$URLS" | sed -E -e 's/https:\/\/([^\/]+).*$/\1/g' | sort | uniq + echo "$URLS" | sed -E -e 's/https:\/\/([^\.]*\.*)([^\/]+).*$/\2/g' | \ + sort | uniq ` # Ensure directory exists diff --git a/run.sh b/run.sh @@ -43,7 +43,9 @@ sed -E -e "s/<\!--MANIFEST-->/\"$MANIFEST\"/" -i "$HTML" # sed -E -e 's/<\!--IMG\ src=\"https:\/\/([^\/]*)[^\"]*(\"[^>]*>)-->/<img src=\"assets\/site-icons\/\1\2 \1/g' -i "$HTML" # insert feed domain -sed -E -e 's/<\!--IMG\ src=\"https:\/\/([^\/]*)[^\"]*(\"[^>]*>)-->/\1/g' -i "$HTML" +sed -E \ + -e 's/<\!--IMG\ src=\"https:\/\/([^\.]*\.*)([^\/]+)[^\"]*(\"[^>]*>)-->/\2/g' \ + -i "$HTML" # Insert feeds list printf "Inserting feeds list...\n"