aboutsummaryrefslogtreecommitdiff
path: root/gemini-to-web/example/build.sh
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2026-02-15 11:19:29 +0100
committeralex <alex@pdp7.net>2026-02-15 11:19:29 +0100
commit6742b12cca1f2f75e32b4c0e4c9447f7f72bc596 (patch)
treef26f52c39243cfb641b3103d5859951fe8168716 /gemini-to-web/example/build.sh
parentbcf8b5a6571fe29f10dc4edac530b630b87c91f7 (diff)
Add some comments
Diffstat (limited to 'gemini-to-web/example/build.sh')
-rwxr-xr-xgemini-to-web/example/build.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/gemini-to-web/example/build.sh b/gemini-to-web/example/build.sh
index 54e2e8f..95d7641 100755
--- a/gemini-to-web/example/build.sh
+++ b/gemini-to-web/example/build.sh
@@ -1,12 +1,20 @@
#!/bin/bash
+# This script demonstrates how to use coppewebite to build a blog from gemtext, including RSS feeds.
+#
+# This scripts uses "uv --process .. run coppewebite-*" to run the coppewebite commands from the source in this repository.
+# If you have installed coppewebite following the instructions, then you can replace that by only "coppewebite-*".
+
set -eu
+# Ensure target is an empty directory.
rm -rf target
mkdir target
+# Copy all content to target.
cp -r source/* target/
+# Create an index page with all posts, from a header followed by the results of coppewebite-indexer.
{
cat <<HEAD
# Welcome to my blog
@@ -15,8 +23,11 @@ HEAD
find . -path './source/2???/??/*.gmi' -type f -print0 | uv --project .. run coppewebite-indexer source/
} >target/index.gmi
+# Generate an RSS feed.
uv --project .. run coppewebite-to-rss <target/index.gmi >target/index.rss --title Example --subtitle Subtitle --base-url https://www.example.com target/
+# Convert all gemtext to HTML.
find target -name '*.gmi' -exec sh -c 'uv --project .. run coppewebite-to-html <{} >$(echo {} | sed s/.gmi/.html/)' ';'
+# Convert index.gmi again, linking the RSS feed.
uv --project .. run coppewebite-to-html <target/index.gmi >target/index.html --feed-href index.rss --feed-title foo