don't copy the seploy script to readme

This commit is contained in:
sakrecoer 2026-07-31 11:52:01 +02:00
parent 34096d5996
commit 106863711c

View file

@ -63,7 +63,7 @@ cp exemple.deploy.sh deploy.sh
This script fetches data from Nostr and converts it to JSON for Hugo. This script fetches data from Nostr and converts it to JSON for Hugo.
You need to cusomize this to yourself: You need to cusomize the top of the file yourself:
```bash ```bash
#!/bin/bash #!/bin/bash
@ -74,37 +74,13 @@ PUBKEY="your_pubkey_here" <---- enter your pubkey
RELAY="wss://relay.damus.io" <---- enter your principal relay RELAY="wss://relay.damus.io" <---- enter your principal relay
DATA_DIR="data" <--- leave as is, useful if you are using a different SSG DATA_DIR="data" <--- leave as is, useful if you are using a different SSG
# Clean up old JSON files (optional) ...
# rm -f data/*/*.json
# Define kind mappings
declare -A KINDS
KINDS[0]="profile/profile"
KINDS[30023]="longform/blog"
KINDS[36787]="music/tracks"
KINDS[20]="pictures/photos"
KINDS[22]="videos/videos"
# Fetch each kind
for kind in "${!KINDS[@]}"; do
output="${KINDS[$kind]}"
echo "Fetching kind $kind..."
# Create directory if it doesn't exist
mkdir -p "$DATA_DIR/$(dirname "$output")"
# Fetch and convert to JSON
nak req -k "$kind" -p "$PUBKEY" "$RELAY" | jq -s '.' > "$DATA_DIR/$output.json"
echo "Saved to $DATA_DIR/$output.json"
done
echo "All data fetched and converted!"
``` ```
### 2. deploy.sh ### 2. deploy.sh
This script handles the full deployment process. You can do this more elegantly, but yeah... this is what i got. This script handles the full deployment process. You can do this more elegantly, but yeah... this is what i got. Same here, customize the top of the file to match your setup
```bash ```bash
#!/bin/sh #!/bin/sh
@ -114,19 +90,7 @@ SITE_DIR="/path/to/your-cloned-git"
WEBROOT="/probably/var/www/html" WEBROOT="/probably/var/www/html"
LOG_FILE="$HOME/nostr-site-deploy.log" LOG_FILE="$HOME/nostr-site-deploy.log"
date '+%Y-%m-%d %H:%M:%S' > $LOG_FILE ...
cd $SITE_DIR
/usr/bin/git pull >> $LOG_FILE
/usr/bin/bash fetch-and-convert.sh >> $LOG_FILE
/snap/bin/hugo --cleanDestinationDir >> $LOG_FILE
# Optional and potentially dangerous: the generator will creates a random file name (fingerprint) for css and js to be picked up when you do changes to it. If you don't remove them, over time your directory will bloat. A new file is only created if there are changes.
# This can be dangerous because if you set the webroot wrong, you're going to nuke stuff you wasn't supposed to.
#/usr/bin/rm $WEBROOT/css/*
#/usr/bin/rm $WEBROOT/js/*
/usr/bin/rsync -av $SITE_DIR $WEBROOT/ >> $LOG_FILE
``` ```