Skip to content

Instantly share code, notes, and snippets.

@nolds9
Forked from jblakeman/html_boilerplate.bash
Created February 17, 2016 21:26
Show Gist options
  • Save nolds9/c7350c894330a2eb3cc7 to your computer and use it in GitHub Desktop.
Save nolds9/c7350c894330a2eb3cc7 to your computer and use it in GitHub Desktop.
HTML Boilerplate Generator
# Output HTML boilerplate code to a file name specified by the first argument
# If no arguments are provided, outputs to index.html
# example:
# html_boilerplate example.html
html_boilerplate() {
local name="$1"
if [[ $name ]]; then
[[ $name != *.html ]] && name+=.html
else
name=index.html
fi
cat << EOF > "$name"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment