1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/lionwiki-t2t_ynh.git synced 2024-09-03 19:36:27 +02:00

update color scheme script

This commit is contained in:
farvardin 2020-04-06 01:13:43 +02:00
parent aca3664ade
commit bc1db8147b
4 changed files with 25 additions and 6 deletions

View file

@ -51,7 +51,7 @@ You can create your own manuscript / handwriting font on http://www.myscriptfont
@MainColor: #549136; @MainColor: #549136;
/* For YunoHost config */ /* For YunoHost config */
@MainColor: __YNH_COLOR__; @MainColor: #__YNH_COLOR__;

View file

@ -99,14 +99,14 @@
"name": "color", "name": "color",
"type": "string", "type": "string",
"ask": { "ask": {
"en": "Set default color base", "en": "Set color base",
"fr": "Définissez la couleur de base" "fr": "Définissez la couleur de base"
}, },
"help": { "help": {
"en": "Use hexadecimal value", "en": "Use hexadecimal value (6 figures without #)",
"fr": "Utilisez une valeur hexadecimale" "fr": "Utilisez une valeur hexadecimale (6 chiffres sans # devant)"
}, },
"example": "#D07732" "example": "D07732"
} }
] ]
} }

View file

@ -5,6 +5,8 @@
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="node-less"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -183,6 +183,10 @@ ynh_add_fpm_config
cp ../conf/config.php $final_path/ cp ../conf/config.php $final_path/
cp ../conf/minimaxing.less $final_path/templates/minimaxing/ cp ../conf/minimaxing.less $final_path/templates/minimaxing/
#cp ../conf/minimaxing.css $final_path/templates/minimaxing/
# we already use the default html template
#cp ../conf/minimaxing.html $final_path/templates/
# Set the password # Set the password
ynh_replace_string --match_string="__YNH_PASSWORD__" --replace_string="$password" --target_file="$final_path/config.php" ynh_replace_string --match_string="__YNH_PASSWORD__" --replace_string="$password" --target_file="$final_path/config.php"
@ -194,7 +198,20 @@ ynh_replace_string --match_string="__YNH_LANG__" --replace_string="$language"
ynh_replace_string --match_string="__YNH_LABEL__" --replace_string="$wiki" --target_file="$final_path/config.php" ynh_replace_string --match_string="__YNH_LABEL__" --replace_string="$wiki" --target_file="$final_path/config.php"
# test if the color was correctly set (6 hexadecimal values)
if echo "$color" | grep -q -E '[A-Fa-f0-9]{6}'
then
ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.less" ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.less"
else
ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="555555" --target_file="$final_path/templates/minimaxing/minimaxing.less"
fi
lessc --js $final_path/templates/minimaxing/minimaxing.less > $final_path/templates/minimaxing/minimaxing.css
#ynh_replace_string --match_string="__YNH_COLOR__" --replace_string="$color" --target_file="$final_path/templates/minimaxing/minimaxing.css"