W3Geek

HTML5 Barebones Template Generator Script

Jul 8th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | None | 0 0
  1. #!/bin/bash
  2. # HTML5 Barebones Template Generator Script
  3. # Developed by Ryan K. Clark
  4. # For more scripts, please visit http://www.tehnewdev.tumblr.com/
  5. # Version 1.0
  6.  
  7. clear
  8.  
  9. echo "Type a name for your file."
  10. sleep 1
  11. read file
  12.  
  13. if [[ -z $file ]]
  14. then
  15. echo "Error 0x001: Not a valid filename."
  16. exit
  17. elif [[ $file =~ \.html$ ]]
  18. then
  19. echo "Error 0x002: $file.html is invalid."
  20. exit
  21. else
  22. clear
  23. echo "Generating $file.html, please wait..."
  24. sleep 1
  25. fi
  26.  
  27. echo "<!DOCTYPE html>" > $file.html
  28. echo -e "" >> $file.html
  29. echo "<html>" >> $file.html
  30. echo -e "\t<head>" >> $file.html
  31. echo -e "\t\t<meta name=\"author\" content=\"HTML5 Barebones Template Generator\" />" >> $file.html
  32. echo -e "\t\t<meta name=\"description\" content=\"HTML5 Barebones Template Generator\" />" >> $file.html
  33. echo -e "\t\t<meta name=\"keywords\" content=\"HTML5, Barebones, Template, Generator\" />" >> $file.html
  34. echo -e "\t\t<meta charset=\"UTF-8\" />" >> $file.html
  35. echo -e "\t\t<title>Untitled Document</title>" >> $file.html
  36. echo -e "\t</head>" >> $file.html
  37. echo -e "\t<body>" >> $file.html
  38. echo -e "\t\t<!-- Insert content here... -->" >> $file.html
  39. echo -e "\t</body>" >> $file.html
  40. echo -n "</html>" >> $file.html
  41.  
  42. echo "Generation Completed! $file.html is located in: "; pwd
Advertisement
Add Comment
Please, Sign In to add comment