Update app.py
Browse files
app.py
CHANGED
|
@@ -232,6 +232,9 @@ def create_hosted_blog(topic, content):
|
|
| 232 |
image_paths.append(f"image_{idx}.png")
|
| 233 |
time.sleep(1)
|
| 234 |
|
|
|
|
|
|
|
|
|
|
| 235 |
# Create professional HTML template
|
| 236 |
html_content = f"""
|
| 237 |
<!DOCTYPE html>
|
|
@@ -282,7 +285,7 @@ def create_hosted_blog(topic, content):
|
|
| 282 |
<p>Published on {datetime.now().strftime("%B %d, %Y")}</p>
|
| 283 |
</div>
|
| 284 |
<div class="content">
|
| 285 |
-
{markdown.markdown(
|
| 286 |
</div>
|
| 287 |
</body>
|
| 288 |
</html>
|
|
@@ -324,4 +327,5 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
|
|
| 324 |
)
|
| 325 |
|
| 326 |
if __name__ == "__main__":
|
|
|
|
| 327 |
app.launch(share=True)
|
|
|
|
| 232 |
image_paths.append(f"image_{idx}.png")
|
| 233 |
time.sleep(1)
|
| 234 |
|
| 235 |
+
# Replace image placeholders first
|
| 236 |
+
updated_content = content.replace("[IMAGE1]", f'').replace("[IMAGE2]", f'')
|
| 237 |
+
|
| 238 |
# Create professional HTML template
|
| 239 |
html_content = f"""
|
| 240 |
<!DOCTYPE html>
|
|
|
|
| 285 |
<p>Published on {datetime.now().strftime("%B %d, %Y")}</p>
|
| 286 |
</div>
|
| 287 |
<div class="content">
|
| 288 |
+
{markdown.markdown(updated_content)}
|
| 289 |
</div>
|
| 290 |
</body>
|
| 291 |
</html>
|
|
|
|
| 327 |
)
|
| 328 |
|
| 329 |
if __name__ == "__main__":
|
| 330 |
+
app.launch(share=True)
|
| 331 |
app.launch(share=True)
|