2020-09-28 17:24:08 +02:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# folder Name
|
|
|
|
|
read -p 'folder name : ' folderName
|
|
|
|
|
# Theme Label
|
|
|
|
|
read -p 'Theme label : ' themeLabel
|
|
|
|
|
# Theme Color
|
|
|
|
|
read -p 'Theme Color (hexa) : ' themeColor
|
2023-03-14 11:21:45 +01:00
|
|
|
|
# custom template
|
|
|
|
|
read -p 'Need custom templates (0/1) : ' variant
|
2020-09-28 17:24:08 +02:00
|
|
|
|
|
|
|
|
|
cd ~/src/publik-base-theme/
|
|
|
|
|
|
2023-03-14 11:21:45 +01:00
|
|
|
|
# create folders
|
|
|
|
|
staticfolderPath=static/$folderName
|
|
|
|
|
mkdir $staticfolderPath
|
|
|
|
|
if [ $variant == 1 ]
|
|
|
|
|
then
|
|
|
|
|
variantfolderPath=templates/variants/$folderName
|
|
|
|
|
mkdir $variantfolderPath
|
|
|
|
|
fi
|
2020-09-28 17:24:08 +02:00
|
|
|
|
|
|
|
|
|
# create config.json file
|
2023-03-14 11:21:45 +01:00
|
|
|
|
cat >${staticfolderPath}/config.json <<EOF
|
2020-09-28 17:24:08 +02:00
|
|
|
|
{
|
|
|
|
|
"label": "${themeLabel}",
|
|
|
|
|
"variables": {
|
|
|
|
|
"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
|
2023-03-14 11:21:45 +01:00
|
|
|
|
touch ${staticfolderPath}/_custom.scss
|
2021-01-29 11:29:38 +01:00
|
|
|
|
|
2023-03-14 11:21:45 +01:00
|
|
|
|
cat >${staticfolderPath}/_vars.scss <<EOF
|
2023-03-07 09:42:01 +01:00
|
|
|
|
\$base-font: 16;
|
2021-01-29 11:29:38 +01:00
|
|
|
|
// Core vars
|
2023-03-07 09:42:01 +01:00
|
|
|
|
\$width: 1280em / \$base-font;
|
|
|
|
|
\$font-size: 100% / ( 16 / \$base-font );
|
2021-09-08 10:55:20 +02:00
|
|
|
|
\$mobile-limit: 64em;
|
|
|
|
|
\$very-small-limit: 35em;
|
2021-01-29 11:29:38 +01:00
|
|
|
|
\$primary-color: ${themeColor};
|
2023-03-14 11:21:45 +01:00
|
|
|
|
\$toplinks-style: none;
|
2021-01-29 11:29:38 +01:00
|
|
|
|
\$widget-unique-checkbox-position: left;
|
2023-03-07 09:42:01 +01:00
|
|
|
|
\$form-title-style: none;
|
2021-01-29 11:29:38 +01:00
|
|
|
|
EOF
|
|
|
|
|
|
2023-03-14 11:21:45 +01:00
|
|
|
|
cat >${staticfolderPath}/style.scss <<EOF
|
2020-09-28 17:24:08 +02:00
|
|
|
|
@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
|