58 lines
1.1 KiB
Bash
Executable File
58 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
||
|
||
# folder Name
|
||
read -p 'folder name : ' folderName
|
||
# Theme Label
|
||
read -p 'Theme label : ' themeLabel
|
||
# Theme Color
|
||
read -p 'Theme Color (hexa) : ' themeColor
|
||
# Active PWA
|
||
read -p 'Active PWA (0/1) : ' pwa
|
||
|
||
cd ~/src/publik-base-theme/
|
||
|
||
# create folder
|
||
themefolderPath=static/$folderName
|
||
mkdir $themefolderPath
|
||
|
||
# store config PWA
|
||
if [ $pwa == 1 ]
|
||
then
|
||
configPWA='"pwa_display": "standalone",'
|
||
fi
|
||
|
||
# create config.json file
|
||
cat >${themefolderPath}/config.json <<EOF
|
||
{
|
||
"label": "${themeLabel}",
|
||
"variables": {
|
||
${configPWA}
|
||
"theme_color": "${themeColor}",
|
||
"email_header_asset": "emails:logo"
|
||
},
|
||
"settings": {
|
||
"combo": {
|
||
"COMBO_ASSET_SLOTS.update": {
|
||
"header:logo": { "label": "Têtière : logo" },
|
||
"emails:logo": {"label": "Emails : logo"}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
EOF
|
||
|
||
# create css files
|
||
touch ${themefolderPath}/_vars.scss ${themefolderPath}/_custom.scss
|
||
cat >${themefolderPath}/style.scss <<EOF
|
||
@charset "UTF-8";
|
||
@import '../includes/fonts/source-sans-pro';
|
||
|
||
@import 'vars';
|
||
@import '../includes/publik';
|
||
@import 'custom';
|
||
EOF
|
||
|
||
# make
|
||
make themes.json
|
||
make css static/$folderName/style.css
|