fix html
This commit is contained in:
@@ -204,20 +204,35 @@ function ios-setup-clone() {
|
||||
echo "Repository found: $target_dir"
|
||||
}
|
||||
|
||||
# Generate bskyweb templates from html/ source
|
||||
# html/ is the source of truth, bskyweb templates are generated
|
||||
# Generate bskyweb templates from web/ build output
|
||||
# web/ is the source of truth, bskyweb templates are generated from dist/aiat/
|
||||
function ios-generate-bskyweb-templates() {
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "🌐 Generating bskyweb templates from html/..."
|
||||
echo "🌐 Generating bskyweb templates from web/..."
|
||||
|
||||
local html_src="$d/html/about/support"
|
||||
local web_dir="$d/../web"
|
||||
local templates="$target_dir/bskyweb/templates"
|
||||
local static_src="$d/html/static"
|
||||
local static_out="$target_dir/bskyweb/static"
|
||||
|
||||
# Check if html source exists
|
||||
if [ ! -d "$html_src" ]; then
|
||||
echo "⚠️ html/about/support not found, skipping template generation"
|
||||
# Check if web directory exists
|
||||
if [ ! -d "$web_dir" ]; then
|
||||
echo "⚠️ web/ directory not found, skipping template generation"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Build web
|
||||
echo " Building web..."
|
||||
cd "$web_dir"
|
||||
npm install --silent 2>/dev/null
|
||||
npm run build --silent 2>/dev/null
|
||||
cd "$d"
|
||||
|
||||
local dist_src="$web_dir/dist/aiat"
|
||||
local static_src="$web_dir/dist/aiat/static"
|
||||
|
||||
# Check if build output exists
|
||||
if [ ! -d "$dist_src" ]; then
|
||||
echo "⚠️ web/dist/aiat not found, build may have failed"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -225,22 +240,18 @@ function ios-generate-bskyweb-templates() {
|
||||
mkdir -p "$templates"
|
||||
mkdir -p "$static_out"
|
||||
|
||||
# Convert html/ to bskyweb templates
|
||||
# Convert web/dist/aiat/ to bskyweb templates
|
||||
# Structure: tos/index.html -> about-tos.html
|
||||
# Add {{ staticCDNHost }} prefix to /static/ paths
|
||||
for html_file in privacy.html license.html tos.html help.html app.html; do
|
||||
if [ -f "$html_src/$html_file" ]; then
|
||||
local template_name="about-${html_file}"
|
||||
for page in privacy license tos help app; do
|
||||
local src_file="$dist_src/$page/index.html"
|
||||
if [ -f "$src_file" ]; then
|
||||
local template_name="about-${page}.html"
|
||||
sed 's|href="/static/|href="{{ staticCDNHost }}/static/|g; s|src="/static/|src="{{ staticCDNHost }}/static/|g' \
|
||||
"$html_src/$html_file" > "$templates/$template_name"
|
||||
"$src_file" > "$templates/$template_name"
|
||||
fi
|
||||
done
|
||||
|
||||
# Also generate about-app.html from index.html if exists
|
||||
if [ -f "$d/html/index.html" ]; then
|
||||
sed 's|href="/static/|href="{{ staticCDNHost }}/static/|g; s|src="/static/|src="{{ staticCDNHost }}/static/|g' \
|
||||
"$d/html/index.html" > "$templates/about-app.html"
|
||||
fi
|
||||
|
||||
# Copy static assets
|
||||
if [ -d "$static_src" ]; then
|
||||
cp -f "$static_src/"* "$static_out/" 2>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user