ai/at
1
0
This commit is contained in:
2025-12-09 22:01:55 +09:00
parent 2a3f9060c5
commit d345b8f62d
10 changed files with 508 additions and 4 deletions

View File

@@ -203,6 +203,55 @@ function ios-setup-clone() {
echo "Repository found: $target_dir"
}
# Generate static HTML for at.syui.ai (CF Pages)
function ios-generate-static-html() {
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🌐 Generating static HTML for at.syui.ai..."
local templates="$target_dir/bskyweb/templates"
local html_out="$d/html/about/support"
local static_out="$d/html/static"
# Check if templates exist
if [ ! -d "$templates" ]; then
echo "⚠️ Templates not found, skipping static HTML generation"
return 1
fi
# Create output directories
mkdir -p "$html_out"
mkdir -p "$static_out"
# Convert templates to static HTML
# Replace {{ staticCDNHost }} with empty string (use relative paths)
for template in about-privacy.html about-license.html about-tos.html about-help.html; do
if [ -f "$templates/$template" ]; then
local output_name="${template#about-}" # Remove 'about-' prefix
sed 's/{{ staticCDNHost }}//g' "$templates/$template" > "$html_out/$output_name"
fi
done
# Copy static assets from ios/assets
local favicon_src="$d/ios/assets/favicons"
if [ -d "$favicon_src" ]; then
cp -f "$favicon_src/favicon.png" "$static_out/" 2>/dev/null
fi
if [ -f "$d/ios/assets/logo.png" ]; then
cp -f "$d/ios/assets/logo.png" "$static_out/app.png"
fi
# Use about-app.html as index.html (root page)
if [ -f "$templates/about-app.html" ]; then
sed 's/{{ staticCDNHost }}//g' "$templates/about-app.html" > "$d/html/index.html"
fi
echo "✅ Generated static HTML in $d/html/"
echo " - index.html (app info)"
echo " - about/support/privacy.html"
echo " - about/support/license.html"
echo ""
}
function ios-setup-reset() {
echo "Resetting social-app repository..."
cd $target_dir
@@ -221,6 +270,7 @@ case "$1" in
ios-patch-apply-all
ios-restore-build-placeholder
ios-copy-new-files
ios-generate-static-html
show-failed-patches
exit
;;
@@ -228,12 +278,18 @@ case "$1" in
ios-setup-reset
exit
;;
html)
# Generate static HTML only (requires patches to be applied first)
ios-generate-static-html
exit
;;
*)
ios-setup-clone
ios-generate-build-number
ios-patch-apply-all
ios-restore-build-placeholder
ios-copy-new-files
ios-generate-static-html
show-failed-patches
;;
esac