Spaces:
Running
Running
Commit
·
74f5da0
1
Parent(s):
6ad097c
Adjust timing in JavaScript execution and remove redundant file writing in post creation
Browse files- post_blog.py +1 -4
post_blog.py
CHANGED
@@ -77,7 +77,7 @@ def generate_post_html(doi, title, category, summary, mindmap, citation):
|
|
77 |
}} else {{
|
78 |
console.log('Element not found');
|
79 |
}}
|
80 |
-
}},
|
81 |
}});
|
82 |
</script>
|
83 |
<style>
|
@@ -119,9 +119,6 @@ def create_post(doi, title, category, summary, mindmap, citation):
|
|
119 |
post_category = f"{category}"
|
120 |
try:
|
121 |
post_body, post_image = generate_post_html(doi, title, category, summary, mindmap, citation)
|
122 |
-
with open('post.html', 'w', encoding='utf-8') as f:
|
123 |
-
f.write(post_body)
|
124 |
-
exit(code=0)
|
125 |
except Exception as e:
|
126 |
print(f"Error generating post: {e}")
|
127 |
return None, None, None, None
|
|
|
77 |
}} else {{
|
78 |
console.log('Element not found');
|
79 |
}}
|
80 |
+
}}, 50);
|
81 |
}});
|
82 |
</script>
|
83 |
<style>
|
|
|
119 |
post_category = f"{category}"
|
120 |
try:
|
121 |
post_body, post_image = generate_post_html(doi, title, category, summary, mindmap, citation)
|
|
|
|
|
|
|
122 |
except Exception as e:
|
123 |
print(f"Error generating post: {e}")
|
124 |
return None, None, None, None
|