static-shite (934B)
1 #!/bin/bash 2 3 printf "Welcome to STATIC SHITE! \n" 4 printf "The Shell Static Site Generator \n" 5 6 prompt(){ 7 printf "COMMAND>" 8 } 9 10 lander(){ 11 printf "Static Shite landers -- simple, name and about.\n" 12 13 printf 'Site name: ' 14 read sname; 15 printf 'About: ' 16 read sabout 17 mkdir $sname 18 touch $sname/index.html; 19 cp style.css $sname/; 20 cp favicon.ico $sname/; 21 printf "<!DOCTYPE html> 22 <html> 23 <head> 24 <title>$sname</title> 25 <meta charset="utf8"> 26 <meta name="viewport" content="width=device-width, initial-scale=1"> 27 <link rel="stylesheet" href="style.css" type="text/css"> 28 <link media="screen" title="index" charset="utf-8"> 29 <link rel="icon" href="favicon.ico"> 30 </head>" >> $sname/index.html 31 printf \n"<p>$sabout</p>" >> $sname/index.html 32 33 34 35 } 36 37 38 quit(){ 39 exit 40 } 41 42 43 comm(){ 44 prompt 45 while read -n 1 cmd; do 46 case $cmd in 47 48 q) 49 quit 50 ;; 51 l) 52 lander 53 ;; 54 55 esac 56 prompt 57 done 58 } 59 60 comm 61