From 1d1105f240f63af0cb57ce2649b7c71eefb70959 Mon Sep 17 00:00:00 2001 From: Solene Rapenne Date: Tue, 20 Jul 2021 23:19:11 +0200 Subject: [PATCH] potcasse: generate an index.html file listing episodes and linking the feed --- README.md | 4 +++- potcasse | 41 +++++++++++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ab06df4..dcd6c26 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ potcasse is meant to help people to publish and self host a podcast easily witho The idea is to regroup audio files with their metadata in a directory and generate the structure that you will publish on a web server. +A simple `index.html` file is also generated in the process to give an easy list without using the RSS file. + ## First time ``` @@ -49,7 +51,7 @@ potcasse episode "Episode XX: trying something weird" /path/to/audio/file this_i potcasse gen ``` -this will create or update the `output_html` directory with your audio files, the RSS file and the logo file if any. +this will create or update the `output_html` directory with your audio files, the RSS file, an index.html file listing all the episodes and the logo file if any. # Real world example diff --git a/potcasse b/potcasse index 945cd8e..ed8780f 100755 --- a/potcasse +++ b/potcasse @@ -58,7 +58,8 @@ EOF gen() { test -d episodes || exitp "You need to import episodes before generation" - TMPFILE=$(mktemp /tmp/potcasse.XXXXXXXXXXXXXXXXXXXXX) + TMPRSS=$(mktemp /tmp/potcasse.XXXXXXXXXXXXXXXXXXXXX) + TMPHTML=$(mktemp /tmp/potcasse.XXXXXXXXXXXXXXXXXXXXX) . ./metadata.sh mkdir -p output_html/episodes @@ -68,7 +69,7 @@ gen() { cp logo.png output_html/logo.png fi - cat <> $TMPFILE + cat <> $TMPRSS @@ -83,6 +84,23 @@ gen() { ${LANG} EOF + cat <> $TMPHTML + + + + ${TITLE} + + +

Podcast episodes- ${TITLE}

+
+ logo +
+ +
    +EOF + for episode in episodes/* do echo "Scanning $episode" @@ -90,22 +108,33 @@ EOF SIZE=$(stat -f "%z" "${episode}/${AUDIOFILE}") EXT=${AUDIOFILE##*.} rsync -a "${episode}/${AUDIOFILE}" output_html/episodes/ - cat <> $TMPFILE + cat <> $TMPRSS $TITLE ${PUBDATE} +EOF + cat <> $TMPHTML +
  • ${PUBDATE} - ${TITLE}
  • EOF done - cat <> $TMPFILE + cat <> $TMPRSS EOF - install -m 644 "$TMPFILE" output_html/${RSSLINK} - rm "$TMPFILE" + + cat <> $TMPHTML +
+ + +EOF + + install -m 644 "$TMPRSS" output_html/${RSSLINK} + install -m 644 "$TMPHTML" output_html/index.html + rm "$TMPRSS" "$TMPHTML" }