Upload build.sh
Browse files
build.sh
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
for f in san-pham/*.html; do
|
| 6 |
if [ -f "$f" ]; then
|
| 7 |
slug="${f#san-pham/}"
|
|
@@ -12,8 +20,7 @@ for f in san-pham/*.html; do
|
|
| 12 |
fi
|
| 13 |
done
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
# The main index.html is in the root
|
| 17 |
if [ -f index.html ]; then
|
| 18 |
sed -i "s|let slugUrl='/san-pham/'+p.slug+'/';|let slugUrl='/san-pham/'+p.slug+'/index.html';|g" index.html
|
| 19 |
sed -i "s|var pUrl=location.origin+'/san-pham/'+p.slug+'/';|var pUrl=location.origin+'/san-pham/'+p.slug+'/index.html';|g" index.html
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
set -e
|
| 3 |
|
| 4 |
+
echo "=== SEO Stub Generator ==="
|
| 5 |
+
|
| 6 |
+
# Install python deps
|
| 7 |
+
pip install huggingface_hub -q 2>/dev/null
|
| 8 |
+
|
| 9 |
+
# Run the SEO generator script
|
| 10 |
+
python3 app/seo_gen.py
|
| 11 |
+
|
| 12 |
+
# Also copy any standalone HTML files (legacy)
|
| 13 |
for f in san-pham/*.html; do
|
| 14 |
if [ -f "$f" ]; then
|
| 15 |
slug="${f#san-pham/}"
|
|
|
|
| 20 |
fi
|
| 21 |
done
|
| 22 |
|
| 23 |
+
# Patch index.html URLs
|
|
|
|
| 24 |
if [ -f index.html ]; then
|
| 25 |
sed -i "s|let slugUrl='/san-pham/'+p.slug+'/';|let slugUrl='/san-pham/'+p.slug+'/index.html';|g" index.html
|
| 26 |
sed -i "s|var pUrl=location.origin+'/san-pham/'+p.slug+'/';|var pUrl=location.origin+'/san-pham/'+p.slug+'/index.html';|g" index.html
|