mirror of
https://github.com/anten-ka/gotelegram_pro.git
synced 2026-05-19 23:46:04 +00:00
feat: expand template catalog to 1978 templates from 5 sources
Added ThemeWagon (1517), dawidolko (172), ColorlibHQ (177). 18 categories with auto-categorization. Updated download_template for new sources.
This commit is contained in:
@@ -249,7 +249,6 @@ download_template() {
|
||||
elif [ -f "$sb_tmp/index.html" ]; then
|
||||
cp -r "$sb_tmp/"* "$clone_dir/"
|
||||
else
|
||||
# fallback: ищем index.html рекурсивно
|
||||
local found_index
|
||||
found_index=$(find "$sb_tmp" -name "index.html" -type f 2>/dev/null | head -1)
|
||||
if [ -n "$found_index" ]; then
|
||||
@@ -260,6 +259,46 @@ download_template() {
|
||||
fi
|
||||
fi
|
||||
rm -rf "$sb_tmp"
|
||||
|
||||
# Для ThemeWagon / ColorlibHQ — каждый шаблон в отдельном репо
|
||||
elif [ "$source" = "themewagon" ] || [ "$source" = "colorlib" ]; then
|
||||
local tw_tmp="/tmp/tw_clone_$$"
|
||||
rm -rf "$tw_tmp"
|
||||
git clone --depth 1 "$repo_url" "$tw_tmp" 2>/dev/null
|
||||
if [ -d "$tw_tmp" ]; then
|
||||
rm -rf "$tw_tmp/.git"
|
||||
if [ -f "$tw_tmp/dist/index.html" ]; then
|
||||
cp -r "$tw_tmp/dist/"* "$clone_dir/"
|
||||
elif [ -f "$tw_tmp/index.html" ]; then
|
||||
cp -r "$tw_tmp/"* "$clone_dir/"
|
||||
else
|
||||
local found_index
|
||||
found_index=$(find "$tw_tmp" -name "index.html" -type f -maxdepth 3 2>/dev/null | head -1)
|
||||
if [ -n "$found_index" ]; then
|
||||
local found_dir
|
||||
found_dir=$(dirname "$found_index")
|
||||
cp -r "$found_dir/"* "$clone_dir/"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -rf "$tw_tmp"
|
||||
|
||||
# Для dawidolko — один большой репо с папками (как learning-zone)
|
||||
elif [ "$source" = "dawidolko" ]; then
|
||||
local tmp_clone="/tmp/dw_clone_$$"
|
||||
rm -rf "$tmp_clone"
|
||||
git clone --depth 1 --filter=blob:none --sparse "$repo_url" "$tmp_clone" 2>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
git clone --depth 1 "$repo_url" "$tmp_clone" 2>/dev/null
|
||||
fi
|
||||
if [ -d "$tmp_clone" ]; then
|
||||
cd "$tmp_clone" && git sparse-checkout set "$sparse_path" 2>/dev/null
|
||||
if [ -d "$tmp_clone/$sparse_path" ]; then
|
||||
cp -r "$tmp_clone/$sparse_path"/* "$clone_dir/"
|
||||
fi
|
||||
cd - >/dev/null
|
||||
fi
|
||||
rm -rf "$tmp_clone"
|
||||
fi
|
||||
|
||||
# Проверяем результат
|
||||
|
||||
Reference in New Issue
Block a user