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

penambahan fitur untuk sub-jalur

This commit is contained in:
Neko Nekowazarashi 2023-05-30 21:24:39 +07:00
parent a17c571666
commit be78c532ca
3 changed files with 22 additions and 2 deletions

View file

@ -1 +1 @@
NEXT_PUBLIC_SITE_DOMAIN=__DOMAIN__ NEXT_PUBLIC_SITE_DOMAIN=__DOMAIN____PATH__

View file

@ -33,7 +33,7 @@ ynh_script_progression --message="Setting the new URL..." --weight=1
if [ $change_domain -eq 1 ] if [ $change_domain -eq 1 ]
then then
ynh_replace_string --match_string="NEXT_PUBLIC_SITE_DOMAIN=$old_domain" --replace_string="NEXT_PUBLIC_SITE_DOMAIN=$new_domain" --target_file="$install_dir/.env.local" ynh_replace_string --match_string="NEXT_PUBLIC_SITE_DOMAIN=$old_domain$old_path" --replace_string="NEXT_PUBLIC_SITE_DOMAIN=$new_domain$new_path" --target_file="$install_dir/.env.local"
fi fi
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
@ -53,6 +53,16 @@ then
ynh_replace_string --match_string="module.exports = { basePath: '$old_next_path', };" --replace_string="module.exports = { basePath: '$new_next_path', };" --target_file="$install_dir/next.config.js" ynh_replace_string --match_string="module.exports = { basePath: '$old_next_path', };" --replace_string="module.exports = { basePath: '$new_next_path', };" --target_file="$install_dir/next.config.js"
ynh_replace_string --match_string="src={useColorModeValue(\"$old_next_path/banner_light.svg\", \"$old_next_path/banner_dark.svg\")}" --replace_string="src={useColorModeValue(\"$new_next_path/banner_light.svg\", \"$new_next_path/banner_dark.svg\")}" --target_file="$install_dir/components/Header.tsx" ynh_replace_string --match_string="src={useColorModeValue(\"$old_next_path/banner_light.svg\", \"$old_next_path/banner_dark.svg\")}" --replace_string="src={useColorModeValue(\"$new_next_path/banner_light.svg\", \"$new_next_path/banner_dark.svg\")}" --target_file="$install_dir/components/Header.tsx"
ynh_replace_string --match_string="href=\"$old_next_path/favicon" --replace_string="href=\"$new_next_path/favicon" --target_file="$install_dir/components/CustomHead.tsx"
ynh_replace_string --match_string="href=\"$old_next_path/apple" --replace_string="href=\"$new_next_path/apple" --target_file="$install_dir/components/CustomHead.tsx"
ynh_replace_string --match_string="start_url\": \"$old_next_path/" --replace_string="start_url\": \"$new_next_path/" --target_file="$install_dir/public/manifest.json"
ynh_replace_string --match_string="scope\": \"$old_next_path/" --replace_string="scope\": \"$new_next_path/" --target_file="$install_dir/public/manifest.json"
ynh_replace_string --match_string="src\": \"$old_next_path/favicon" --replace_string="src\": \"$new_next_path/favicon" --target_file="$install_dir/public/manifest.json"
fi fi
#================================================= #=================================================

View file

@ -58,6 +58,16 @@ echo "module.exports = { basePath: '$next_path', };" >> "$install_dir/next.confi
ynh_replace_string --match_string="src={useColorModeValue(\"/banner_light.svg\", \"/banner_dark.svg\")}" --replace_string="src={useColorModeValue(\"$next_path/banner_light.svg\", \"$next_path/banner_dark.svg\")}" --target_file="$install_dir/components/Header.tsx" ynh_replace_string --match_string="src={useColorModeValue(\"/banner_light.svg\", \"/banner_dark.svg\")}" --replace_string="src={useColorModeValue(\"$next_path/banner_light.svg\", \"$next_path/banner_dark.svg\")}" --target_file="$install_dir/components/Header.tsx"
ynh_replace_string --match_string="href=\"/favicon" --replace_string="href=\"$next_path/favicon" --target_file="$install_dir/components/CustomHead.tsx"
ynh_replace_string --match_string="href=\"/apple" --replace_string="href=\"$next_path/apple" --target_file="$install_dir/components/CustomHead.tsx"
ynh_replace_string --match_string="start_url\": \"/" --replace_string="start_url\": \"$next_path/" --target_file="$install_dir/public/manifest.json"
ynh_replace_string --match_string="scope\": \"/" --replace_string="scope\": \"$next_path/" --target_file="$install_dir/public/manifest.json"
ynh_replace_string --match_string="src\": \"/favicon" --replace_string="src\": \"$next_path/favicon" --target_file="$install_dir/public/manifest.json"
#================================================= #=================================================
# BUILD AND INSTALL THE APP # BUILD AND INSTALL THE APP
#================================================= #=================================================