Advertisement
metalx1000

HTML Generator

Mar 26th, 2015
856
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ "$1" = "" ]
  4. then
  5.   echo "What do you want to call your project?"
  6.   read dir
  7. else
  8.   dir="$1"
  9. fi
  10.  
  11. echo "Creating Directories for $dir"
  12. mkdir -p "$dir/js"
  13. mkdir -p "$dir/css"
  14.  
  15. echo "Getting some JavaScript Libraries..."
  16. wget "http://code.jquery.com/jquery-1.11.2.min.js" -O "$dir/js/jquery.js"
  17. wget "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js" -O "$dir/js/bootstrap.js"
  18. wget "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js" -O "$dir/js/jquery.mobile.js"
  19.  
  20. echo "Getting Some CSS Files..."
  21. wget "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" -O "$dir/css/jquery.mobile.css"
  22. wget "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" -O "$dir/css/bootstrap.min.css"
  23. wget "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css" -O "$dir/css/bootstrap-theme.min.css"
  24.  
  25. clear
  26. echo "Creating basic HTML file..."
  27. cat << EOF >> "$dir/index.html"
  28. <!DOCTYPE html>
  29. <html>
  30. <head>
  31.   <!-- Include meta tag to ensure proper rendering and touch zooming -->
  32.   <meta name="viewport" content="width=device-width, initial-scale=1">
  33.   <!-- Include stylesheets
  34.   <link rel="stylesheet" href="css/jquery.mobile.css">
  35.   <link rel="stylesheet" href="css/bootstrap.min.css">
  36.   <link rel="stylesheet" href="css/bootstrap-theme.min.css">
  37.   -->
  38.   <!-- Include JavaScript libraries -->
  39.   <script src="js/jquery.js"></script>
  40.   <!--<script src="js/bootstrap.js"></script>-->
  41.   <!--<script src="js/jquery.mobile.js"></script>-->
  42.  
  43.   <script>
  44.   \$(document).ready(function(){
  45.   });
  46.   </script>
  47. </head>
  48. <body>
  49.  
  50. </body>
  51. </html>
  52. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement