File bin/modules/public.sh
Last commit: Mon Dec 9 23:02:59 2024 +0100 Jan Dankert Delete files on the target host for sites.
1 #!/bin/bash 2 3 # Build website for repo 4 if [ ! -d $public_dir ]; then 5 echo "Directory does not exist: $public_dir" 6 return 4 7 fi 8 9 mkdir -p $public_dir/$REPO_NAME 10 git archive HEAD | tar -x -C $public_dir/$REPO_NAME 11 12 13 # Creating Index 14 if ( is_on $public_index_create ); then 15 echo "Creating index in $public_dir" 16 ( echo "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=2\" /></head><body><pre>" 17 ( cd $public_dir; find . -maxdepth 1 -type d -printf '<a href="./%P">%P</a>\n' ) 18 echo "</pre></body></html>" ) > $public_dir/index.html 19 fi 20 21 # Creating HTML from MD 22 if ( is_on $public_markdown_to_html ); then 23 ( cd $public_dir; find . -type f -name "*.md" -exec pandoc -f markdown -t html -o {}.html {} \; ) 24 fi 25 26 if [ -n "$public_sync_ssh_host" ]; then 27 echo "Syncing to $public_sync_ssh_host ..." 28 rsync -a --delete -e ssh $public_dir/ $public_sync_ssh_user@$public_sync_ssh_host:$public_sync_ssh_path 2>&1 29 fi 30 31
Downloadbin/modules/public.sh
History Mon, 9 Dec 2024 23:02:59 +0100 Jan Dankert Delete files on the target host for sites. Sun, 8 Dec 2024 23:38:18 +0100 Jan Dankert Fix: We do not need the whole repository in the projects site. Tue, 26 Nov 2024 23:26:36 +0100 Jan Dankert New: Creating a project website