1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-09-11 19:32:24 +02:00

Merge branch 'develop' into testing

This commit is contained in:
GilbN 2022-03-31 20:59:19 +02:00
commit 06bd01c648
2 changed files with 15 additions and 13 deletions

View File

@ -19,8 +19,8 @@ if [[ -z ${TP_DOMAIN} ]]; then
fi
if [[ -z ${TP_SCHEME} ]]; then
echo 'No scheme set, defaulting to https'
TP_SCHEME='https'
echo 'No scheme set, defaulting to $scheme'
TP_SCHEME='$scheme'
fi
if [[ -z ${TP_URLBASE} ]]; then
@ -36,15 +36,17 @@ esac
DEFAULT='/defaults/default'
if [[ ${TP_URLBASE} ]]; then
echo "seding location"
sed -i "s/location \//location \/${TP_URLBASE}/g" ${DEFAULT}
echo "seding TP_DOMAIN"
sed -i "s/TP_DOMAIN/${TP_DOMAIN}/g" ${DEFAULT}
sed -i "s/TP_URLBASE/${TP_URLBASE}/g" ${DEFAULT}
sed -i "s/#sub_filter/sub_filter/g" ${DEFAULT}
sed -i "s/#location#/location /g" ${DEFAULT}
if ! grep -q "location /${TP_URLBASE} {" "${DEFAULT}"; then
sed -i "s/location \//location \/${TP_URLBASE}/g" ${DEFAULT}
sed -i "s/TP_DOMAIN/${TP_DOMAIN}/g" ${DEFAULT}
sed -i "s/TP_URLBASE/${TP_URLBASE}/g" ${DEFAULT}
sed -i "s/#sub_filter/sub_filter/g" ${DEFAULT}
sed -i "s/#location#/location /g" ${DEFAULT}
sed -i "s/\$scheme/${TP_SCHEME}/g" ${DEFAULT}
fi
elif [[ -z ${TP_URLBASE} ]]; then
sed -i "s/TP_DOMAIN\/TP_URLBASE/${TP_DOMAIN}/g" ${DEFAULT}
sed -i "s/\$scheme/${TP_SCHEME}/g" ${DEFAULT}
fi
cp /defaults/default /config/nginx/site-confs

View File

@ -119,20 +119,20 @@ def create_json(app_folders: list = None, themes: list = None, community_themes:
def create_theme_options():
def create_css(folder):
with open(f"{folder}/{app}/{theme.lower()}.css", "w") as create_app:
content = f'@import url("{applications[app]["base_css"]}");\n@import url("{themes[theme]["url"]}");'
content = f'@import url("{applications[app]["base_css"]}");\n@import url("{all_themes[theme]["url"]}");'
create_app.write(content)
with open("themes.json") as themes:
data = load(themes)
themes = data["all-themes"]
all_themes = data["all-themes"]
applications = data["applications"]
for app in applications:
for theme in themes:
for theme in all_themes:
folders = ["./css/base"]
for folder in folders:
create_css(folder)
env_domain = env.get('TP_DOMAIN')
scheme = env.get('TP_SCHEME','https')
scheme = env.get('TP_SCHEME','https') if env.get('TP_SCHEME') != '$scheme' else 'https'
if __name__ == "__main__":
app_folders = [name for name in listdir('./css/base') if isdir(join('./css/base', name))]