home | list info | list archive | date index | thread index

Re: Static site generation

Further to previous exchanges, I've now settled on how I will run a set of more easily accessible HowTo notes that
our household can share. While the intent is to have a local collection, this should work more widely.

My main motivation is to AVOID any real action other than saving a file / screenshot / download / textnotes. Thus
while ZIM looked very interesting, I could quickly see that only I would do any update, and often I'd get
distracted and it would not be done.

So ... I discovered a very interesting small option of the 'tree' command. 'tree -H' generates HTML.  So here
are my two short scripts that do the work. I'm sure there are improvements possible, but I like the simplicity
and ease of use.

Comments welcome.

John Nash

#!/bin/bash
#
# vhowto  John C Nash 20260820
#
echo "vhowto -- View HowTo files. Note this version for (name) on (machine)"
#
# Settings
locdir=(where you store the directory of how-to files with topic subdirectories)

# IMPORTANT: For Synology note 'volume1' in rmtdir
rmtdir=(remote version of file collection)
user=(username)
synip=(remote IP or address)
#
# Update local set of files
rsync -avz -e ssh $user@$synip:$rmtdir $locdir
# update tree file
cd $locdir
tree -H ./ >howto.htm
firefox -P default ./howto.htm


#!/bin/bash
#
# updatevhowto  John C Nash 20260820
#
echo "updatevhowto -- Update HowTo files. Note this version for (name) on (machine)"
#
# Settings
locdir=(where you store the directory of how-to files with topic subdirectories)

# IMPORTANT: For Synology note 'volume1' in rmtdir
rmtdir=(remote version of file collection)
user=(username)
synip=(remote IP or address)
#
# Update local set of files
rsync -avz -e ssh $user@$synip:$rmtdir $locdir
#
read -p "Now fix files in DoubleCommander" tmp
# update files
doublecmd -L "$locdir" -R "$locdir" 2>/dev/null

# Put back with delete
rsync  --delete -avz --no-g -e ssh $locdir $user@$synip:$rmtdir

echo "done"


To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org