sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit 736737aeb179eb591859683214146995d777fd7e
parent 0bae1d80d701946ec498a5cb5eaef372960d94e7
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Thu,  9 Feb 2023 22:00:58 -0500

Remove Gemini to Markdown Conversion Code

I'm moving away from Gemini and don't need this functionality anymore.
Plus, it would have been a bit of a pain to also add the functionality
for making a feed out of Gemini code so Gemini support would have
remained half-baked. A dedicated tool for Gemini is a better solution.

Diffstat:
Msbs | 23-----------------------
1 file changed, 0 insertions(+), 23 deletions(-)

diff --git a/sbs b/sbs @@ -181,29 +181,6 @@ build() subDir=$(dirname "$file" | sed "s/.*\/content//") mkdir -p "static/$subDir" - # Convert Gemtext files to Markdown - # The first sed expression converts all local links that end - # in .gmi to .html (e.g. /blog/post1.gmi --> /blog/post1.html). - # The second sed expression converts all gemini-style links to - # markdown-style links. - # The third sed expression fixes gemini links that only have a - # URL so that the URL will be displayed as the link text. - # The fourth sed expression converts links to images into - # Markdown's image syntax, so images will be displayed with the - # <img> tag. - if [ "$(echo "$file" | awk -F\. '{print $NF}' )" = "gmi" ]; then - printf "Converting: content%s/%s to markdown...\n" "$subDir" "$fileName" - fileName=$(basename "$file" .gmi) - sed -e 's/\(=>[ ]*\)\(.*\)\(.gmi\)\(.*\)/\1\2.html\4/g' \ - -e 's/=>[ ]*\([^ ]*\)\( \|\)\(.*\)/[\3](\1)\n/g' \ - -e 's/\[\](\(.*\))/[\1](\1)/g' \ - -e 's/\(\[.*\]\)\((\(.*.jpe\?g\|.*.png\))\)/!\1\2/g' \ - "$file" > /tmp/sbs/"$fileName".md - title=$(grep '^# ' "$file" | head -n1 | cut -d' ' -f2-) - description="Page auto-converted from the Gemini format." - file=/tmp/sbs/"$fileName".md - fi - printf "Creating: static%s/%s.html...\n" "$subDir" "$fileName" # Extract metadata from markdown doc (if not converted from gmi)