cabinSource code for personal website | 
          
| git clone git://git.dimitrijedobrota.com/cabin.git | 
| Log | Files | Refs | README | LICENSE | 
cabin-deploy.sh (1126B)
    0 #!/bin/bash
          
              2 # cabin-deploy.sh: generate blog files and deploy to server
          
              4 # Take contents of the source and copy it to destination
              5 # Turn markdown into html in the process and create indexes
              6 # At the end send everything to the server
          
              8 if [ "$#" -ne 2 ]; then
              9         echo "Error: Invalid number of arguments"
             10         echo "Usage: $0 source destination"
             11         exit 1
             12 fi
          
             14 src="$(realpath $1)"
             15 dst="$(realpath $2)"
          
             17 # copy all of the files from source to desination
             18 # excluding md files and .git subdirectory
             19 pushd "$src" || exit
             20 find . -not -iname "*.md" -a -not -path "*.git*" | cpio -pd "$dst" 2>/dev/null
             21 popd || exit
          
             23 opt=()
             24 opt+=(--author "Dimitrije Dobrota")
             25 opt+=(--base "https://dimitrijedobrota.com")
             26 opt+=(--email "mail@dimitrijedobrota.com")
             27 opt+=(--desc "Contents of Dimitrije Dobrota's blog")
             28 opt+=(--summary "Click on the article link to read...")
          
             30 # Convert all the md files to articles
             31 # Create all the indexes
             32 stamd "${opt[@]}" --output "$dst/blog" --index $src/blog/*.md
          
             34 # Create a home page
             35 stamd "${opt[@]}" --output "$dst" $src/*.md
          
             37 # Copy everything to the server
             38 rsync -a $dst/* server:/var/www/cabin