# CREATE A SIMPLE APP STRUCTURE
# 1) Open up your Terminal, then load your .bash_profile using VIM, for instance,
# Or just type `open .bash_profile` and it will open it on your default text editor.
# Type in the following:
# 2) This is the HTML boilerplate for your index.html file what we are storing in a
# variable called `html_boilerplate`. Include this in first.
html_boilerplate='
'
# Of course, this HTML code you can customise it however you want. This
# sample code serves my common needs of setting up an index.html.
# 3) This function generates the directory structure. Type this next.
# In essence this is the function that will do the heavy lifting
# generating the folder structure.
function create-site {
mkdir $1
pushd $1
mkdir css &&
mkdir scss &&
touch scss/app.scss &&
mkdir imgs &&
mkdir js &&
touch js/scripts.js &&
touch index.html &&
echo "$html_boilerplate" >> index.html # <-- this command appends in the index.html file the content stored in the `html_boilerplate` variable.
popd
}
# 4) Once you are done, save this file and make sure to run on the terminal
# `source .bash_profile` to rerun the .bash_profile and make sure the system
# acknowledges your updates.
# 5) Now, open a new tab on the terminal, and go to a directory and run:
# `create-site yourfoldername`. Make sure you replace yourfoldername to whatever
# name you want to give your directory.
# 6) You should see now a new directory created with this directory structure:
# yourfoldername
# │ ├── scss
# │ │ └── app.scss
# │ ├── css
# │ ├── js
# │ │ └── scripts.js
# │ ├── imgs
# │ └── index.html
# Hopefully this little code on your bash will help you create site structures
# To get you going quickly.