mroccuper commited on
Commit
38cd108
Β·
verified Β·
1 Parent(s): e83180e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +106 -27
app.py CHANGED
@@ -126,22 +126,81 @@ WRITING STYLE:
126
  - Write in {pov} person consistently
127
  - Maintain {tone.lower()} tone throughout
128
 
129
- TECHNICAL SEO ELEMENTS:
130
- - Include relevant HTML tags (H1, H2, H3, strong, em)
131
- - Use bullet points and numbered lists for readability
132
- - Include natural keyword density (1-2%)
133
- - Add semantic keywords and LSI terms
134
- - Structure for featured snippets
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
  OUTPUT FORMAT:
137
  Provide the complete article with:
138
  1. Meta title and description at the top
139
- 2. Full HTML-formatted article with proper heading tags
140
- 3. Natural integration of provided internal links
141
- 4. FAQ section with schema-friendly format
142
- 5. Conclusion with engagement elements
 
143
 
144
- Generate the article now, ensuring it's comprehensive, valuable, and optimized for 2025 SEO standards in the fermentation niche.
145
  """
146
  return prompt
147
 
@@ -228,20 +287,33 @@ Format as a numbered list.
228
  <meta charset="UTF-8">
229
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
230
  <title>Generated SEO Article</title>
 
231
  <style>
232
- body {{ font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; line-height: 1.6; color: #333; }}
233
- h1 {{ color: #2c3e50; border-bottom: 2px solid #3498db; padding-bottom: 10px; }}
234
- h2 {{ color: #34495e; margin-top: 30px; }}
235
- h3 {{ color: #7f8c8d; }}
236
- .meta {{ background: #ecf0f1; padding: 15px; margin: 20px 0; border-radius: 5px; }}
237
- .readability {{ background: #e8f5e8; padding: 15px; margin: 20px 0; border-radius: 5px; }}
238
- .titles {{ background: #fff3cd; padding: 15px; margin: 20px 0; border-radius: 5px; }}
239
- ul, ol {{ margin: 15px 0; }}
240
- li {{ margin: 5px 0; }}
 
 
 
 
 
 
 
 
 
 
241
  </style>
242
  </head>
243
  <body>
244
- {final_output.replace(chr(10), '<br>').replace('**', '<strong>').replace('*', '<em>')}
 
 
245
  </body>
246
  </html>
247
  """
@@ -408,14 +480,21 @@ def create_interface():
408
 
409
  gr.Markdown("""
410
  ---
411
- ### πŸ’‘ Tips for Best Results:
 
 
 
 
 
 
 
412
  - Use specific fermentation-related keywords in your SEO plan
413
- - Include 2-4 internal links with relevant anchor text
414
- - Add 5-10 related keywords for semantic SEO
415
  - Longer content typically performs better for competitive keywords
416
- - Review the readability score and adjust if needed for your audience
417
 
418
- **Powered by Gemini 1.5 Pro API** | Built for Fermentation Content Creators
419
  """)
420
 
421
  return app
@@ -427,5 +506,5 @@ if __name__ == "__main__":
427
  #server_name="0.0.0.0",
428
  #server_port=7860,
429
  #share=True,
430
- show_error=True
431
  )
 
126
  - Write in {pov} person consistently
127
  - Maintain {tone.lower()} tone throughout
128
 
129
+ HTML STRUCTURE & TECHNICAL REQUIREMENTS:
130
+ CRITICAL: Follow these HTML best practices exactly:
131
+
132
+ 1. **Clean HTML Structure:**
133
+ - Use semantic HTML5 elements: <section>, <article>, <header>
134
+ - Wrap major content sections in <section> tags
135
+ - No placeholder text for images/videos - use HTML comments instead
136
+ - Clean, professional code structure
137
+
138
+ 2. **Schema Markup:**
139
+ - Complete FAQPage schema with proper opening/closing divs
140
+ - Include at least 5-8 FAQ items with full schema markup
141
+ - Ensure all schema containers are properly closed
142
+
143
+ 3. **Content Organization:**
144
+ - No inline questions within list items
145
+ - Separate Q&A content into dedicated paragraphs or FAQ section
146
+ - Use proper paragraph structure for readability
147
+
148
+ 4. **Media Placeholders:**
149
+ - Replace "(Include photos here)" with: <!-- Step-by-step photos go here -->
150
+ - Replace "(Embed video)" with: <!-- Video tutorial embed -->
151
+ - Use commented HTML examples for future media
152
+
153
+ 5. **Links and References:**
154
+ - Use real, working links when possible
155
+ - If using example.com, make it clear it's a placeholder
156
+ - Include rel="noopener" for external links
157
+
158
+ 6. **Accessibility:**
159
+ - Include lang="en" in html tag
160
+ - Prepare alt text suggestions in comments for images
161
+ - Use semantic heading hierarchy
162
+
163
+ EXAMPLE HTML STRUCTURE TO FOLLOW:
164
+ ```html
165
+ <section>
166
+ <h2>Section Title</h2>
167
+ <p>Content here...</p>
168
+
169
+ <h3>Subsection</h3>
170
+ <ol>
171
+ <li>Step one</li>
172
+ <li>Step two</li>
173
+ </ol>
174
+
175
+ <p><strong>Common Question:</strong> Answer here...</p>
176
+ <!-- Step-by-step photos go here -->
177
+ <!-- <img src="path/image.jpg" alt="Description"> -->
178
+ </section>
179
+
180
+ <section>
181
+ <h2>FAQ Section</h2>
182
+ <div itemscope itemtype="https://schema.org/FAQPage">
183
+ <div itemscope itemtype="https://schema.org/Question">
184
+ <h3 itemprop="name">Question?</h3>
185
+ <div itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer">
186
+ <p itemprop="text">Answer here.</p>
187
+ </div>
188
+ </div>
189
+ <!-- Add 5-8 more FAQ items -->
190
+ </div> <!-- Close FAQPage -->
191
+ </section>
192
+ ```
193
 
194
  OUTPUT FORMAT:
195
  Provide the complete article with:
196
  1. Meta title and description at the top
197
+ 2. Full HTML-formatted article with proper semantic structure
198
+ 3. Complete FAQ section with 6-8 questions and proper schema
199
+ 4. Clean, professional HTML with no placeholder text
200
+ 5. Commented placeholders for media elements
201
+ 6. Natural integration of provided internal links
202
 
203
+ Generate the article now, ensuring it follows all HTML best practices and is optimized for 2025 SEO standards.
204
  """
205
  return prompt
206
 
 
287
  <meta charset="UTF-8">
288
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
289
  <title>Generated SEO Article</title>
290
+ <meta name="description" content="Generated fermentation SEO article optimized for 2025 standards">
291
  <style>
292
+ body {{ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; max-width: 900px; margin: 0 auto; padding: 20px; line-height: 1.7; color: #333; background: #fafafa; }}
293
+ .container {{ background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }}
294
+ h1 {{ color: #2c3e50; border-bottom: 3px solid #27ae60; padding-bottom: 15px; font-size: 2.2em; }}
295
+ h2 {{ color: #34495e; margin-top: 35px; margin-bottom: 15px; font-size: 1.6em; border-left: 4px solid #27ae60; padding-left: 15px; }}
296
+ h3 {{ color: #7f8c8d; margin-top: 25px; font-size: 1.3em; }}
297
+ section {{ margin: 30px 0; padding: 20px 0; border-bottom: 1px solid #eee; }}
298
+ section:last-child {{ border-bottom: none; }}
299
+ .meta-info {{ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; margin: 20px 0; border-radius: 8px; }}
300
+ .readability {{ background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); color: white; padding: 20px; margin: 20px 0; border-radius: 8px; }}
301
+ .titles {{ background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); padding: 20px; margin: 20px 0; border-radius: 8px; }}
302
+ ul, ol {{ margin: 20px 0; padding-left: 25px; }}
303
+ li {{ margin: 8px 0; }}
304
+ .faq-section {{ background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0; }}
305
+ .faq-item {{ margin: 15px 0; }}
306
+ a {{ color: #27ae60; text-decoration: none; font-weight: 500; }}
307
+ a:hover {{ text-decoration: underline; }}
308
+ code {{ background: #f1f2f6; padding: 2px 6px; border-radius: 3px; font-family: 'Courier New', monospace; }}
309
+ .highlight {{ background: #fff3cd; padding: 2px 6px; border-radius: 3px; }}
310
+ .schema-markup {{ background: #e3f2fd; border-left: 4px solid #2196f3; padding: 15px; margin: 15px 0; }}
311
  </style>
312
  </head>
313
  <body>
314
+ <div class="container">
315
+ {final_output}
316
+ </div>
317
  </body>
318
  </html>
319
  """
 
480
 
481
  gr.Markdown("""
482
  ---
483
+ ### πŸ’‘ **Updated for Clean HTML Generation:**
484
+ - βœ… **Semantic HTML5** - Uses proper `<section>` tags and structure
485
+ - βœ… **Complete Schema Markup** - Properly closed FAQ schema with 6-8 questions
486
+ - βœ… **No Placeholder Text** - Clean HTML comments for media placeholders
487
+ - βœ… **Accessibility Ready** - Proper lang attributes and semantic structure
488
+ - βœ… **Professional Code** - No inline Q&A in lists, clean paragraph structure
489
+
490
+ ### 🎯 **Tips for Best Results:**
491
  - Use specific fermentation-related keywords in your SEO plan
492
+ - Include 2-4 internal links with relevant anchor text (keyword:link format)
493
+ - Add 5-10 related keywords for semantic SEO enhancement
494
  - Longer content typically performs better for competitive keywords
495
+ - Generated HTML is production-ready with proper schema markup
496
 
497
+ **Powered by Gemini 1.5 Pro API** | Built for Professional Fermentation Content
498
  """)
499
 
500
  return app
 
506
  #server_name="0.0.0.0",
507
  #server_port=7860,
508
  #share=True,
509
+ #show_error=True
510
  )