~aprates/gempress

91151963164dbb160c2bde9f6313bb73adf04c01 — Antonio Prates 7 months ago fa2bd5b
Fix for absoulte path on home feed
2 files changed, 11 insertions(+), 2 deletions(-)

A src/absolute.c
M src/lib.sh
A src/absolute.c => src/absolute.c +9 -0
@@ 0,0 1,9 @@
#include <sugar.h>

app({
  if (argc > 2) {
    string in = readFile((argv[1]));
    if (in)
      println(replaceWord(in, "=> ", join3s("=> /", argv[2], "/")));
  }
})

M src/lib.sh => src/lib.sh +2 -2
@@ 33,8 33,8 @@ function appendFeedToHome() {
    for feed in $capsule/$feedDir/feed.gmi; do
        head -$maxHomeEntries $feed
    done > $capsule/index.gmi.feed
    sed -i "s/=> /=> $absoluteFeedDir\//" $capsule/index.gmi.feed
    cat $capsule/index.gmi.feed >> $capsule/index.gmi
    cat $capsule/index.gmi.feed
    sugar src/absolute.c $capsule/index.gmi.feed $absoluteFeedDir >> $capsule/index.gmi
    rm $capsule/index.gmi.feed
}