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