-
-
Save nolds9/c7350c894330a2eb3cc7 to your computer and use it in GitHub Desktop.
HTML Boilerplate Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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