~aprates/gempress

fae9d5483f8e89275a8384bb94351ee12310113b — Antonio Prates 7 months ago 7cb0bff
Add feedDir to urls on appendFeedToHome

This is a better decision, yet ideally
could support both adresses with slashes
and without them.
1 files changed, 5 insertions(+), 2 deletions(-)

M src/lib.sh
M src/lib.sh => src/lib.sh +5 -2
@@ 26,12 26,15 @@ function appendFeedToHome() {
    cat $capsule/$feedDir/index.gmi | grep "=> " > $capsule/$feedDir/feed.gmi
    for feed in $capsule/$feedDir/feed.gmi; do
        head -$maxHomeEntries $feed
    done >> $capsule/index.gmi
    done > $capsule/index.gmi.feed
    sed -i "s/=> /=> $feedDir\//" $capsule/index.gmi.feed
    cat $capsule/index.gmi.feed >> $capsule/index.gmi
    rm $capsule/index.gmi.feed
}

# resets feed (to remove footer) and add link to home
function linkFeedToHome() {
    echo -e "Resetting feed file and appending home link:\n$capsule/$feedDir/index.gmi"
    echo -e "Appending only home link to feed:\n$capsule/$feedDir/index.gmi"
    cp -f $localBaseDir/$feedDir/index.gmi $capsule/$feedDir/index.gmi
    echo -e "\n$gmiLinkHome\n" >> $capsule/$feedDir/index.gmi
}