#!/bin/bash

grid() {
# usage
    local LANG=C
    if [ "$1" = "help" ]; then
    echo "Usage: ${0##*/} [options]"
    echo '    start="start"            Start grid'
    echo '    rowColumn="number"       number of columns per row'
    echo '    colStart="colStart"      Start column'
    echo '    colEnd="colEnd"          End column'
    echo '    end="end"                end grid'
    echo ''
    fi

#It is only necessary to declare the variables that need changes in the content, the file that calls this script already creates the variable that will be used in the script

rowColumn="${rowColumn:+row-cols-$rowColumn}"

# start
if [ -n "$start" ];then
read -d $'' ShowText <<EOF
<div class="container text-center">
  <div class="row $rowColumn">
EOF
echo "$ShowText"
fi

# colStart
if [ -n "$colStart" ];then
echo '<div class="col">'
fi

# colEnd
if [ -n "$colEnd" ];then
echo "</div>"
fi

# end
if [ -n "$end" ];then
read -d $'' ShowText <<EOF
  </div>
</div>
EOF
echo "$ShowText"
fi

}
