new-theme: add create variant folder option

This commit is contained in:
Thomas Jund 2023-03-14 11:21:45 +01:00
parent 26ae14f955
commit 1e1238e14a
1 changed files with 15 additions and 8 deletions

View File

@ -6,15 +6,22 @@ read -p 'folder name : ' folderName
read -p 'Theme label : ' themeLabel
# Theme Color
read -p 'Theme Color (hexa) : ' themeColor
# custom template
read -p 'Need custom templates (0/1) : ' variant
cd ~/src/publik-base-theme/
# create folder
themefolderPath=static/$folderName
mkdir $themefolderPath
# create folders
staticfolderPath=static/$folderName
mkdir $staticfolderPath
if [ $variant == 1 ]
then
variantfolderPath=templates/variants/$folderName
mkdir $variantfolderPath
fi
# create config.json file
cat >${themefolderPath}/config.json <<EOF
cat >${staticfolderPath}/config.json <<EOF
{
"label": "${themeLabel}",
"variables": {
@ -33,9 +40,9 @@ cat >${themefolderPath}/config.json <<EOF
EOF
# create css files
touch ${themefolderPath}/_custom.scss
touch ${staticfolderPath}/_custom.scss
cat >${themefolderPath}/_vars.scss <<EOF
cat >${staticfolderPath}/_vars.scss <<EOF
\$base-font: 16;
// Core vars
\$width: 1280em / \$base-font;
@ -43,12 +50,12 @@ cat >${themefolderPath}/_vars.scss <<EOF
\$mobile-limit: 64em;
\$very-small-limit: 35em;
\$primary-color: ${themeColor};
\$toplinks-style:
\$toplinks-style: none;
\$widget-unique-checkbox-position: left;
\$form-title-style: none;
EOF
cat >${themefolderPath}/style.scss <<EOF
cat >${staticfolderPath}/style.scss <<EOF
@charset "UTF-8";
@import '../includes/fonts/source-sans-pro';