diff --git a/test/website/test_process_notebooks.py b/test/website/test_process_notebooks.py index 7e074b7e5..1644b26be 100644 --- a/test/website/test_process_notebooks.py +++ b/test/website/test_process_notebooks.py @@ -270,6 +270,64 @@ def test_dir(self): tags: [Realtime API, Voice Agents, Swarm Teams, Twilio, AI Tools] --- +
+ social preview +
+ +
+

Authors:

+ + +
+
+ +
+
+

Mark Sze

+

Software Engineer at AG2.ai

+
+
+
+ +
+
+ +
+
+

Tvrtko Sternak

+

Machine Learning Engineer at Airt

+
+
+
+ +
+
+ +
+
+

Davor Runje

+

CTO at Airt

+
+
+
+ +
+
+ +
+
+

Davorin

+

Developer

+
+
+
+
+
+ lorem ipsum""").lstrip() (post2_dir / "index.mdx").write_text(post2_content) @@ -332,6 +390,9 @@ def test_add_authors_and_social_img(self, test_dir): assert '

Chi Wang

' in actual assert '

Davor Runje

' not in actual + assert actual.count('
') == 1 + assert actual.count('

Chi Wang

') == 1 + # Verify content of second blog post post2_path = generated_blog_dir / "2023-06-28-MathChat" / "index.mdx" actual = post2_path.read_text() @@ -343,6 +404,9 @@ def test_add_authors_and_social_img(self, test_dir): assert '

Davorin

' in actual assert '

Chi Wang

' not in actual + assert actual.count('
') == 1 + assert actual.count('

Mark Sze

') == 1 + class TestConvertCalloutBlocks: @pytest.fixture diff --git a/website/process_notebooks.py b/website/process_notebooks.py index dd254f0fd..56f850e83 100755 --- a/website/process_notebooks.py +++ b/website/process_notebooks.py @@ -872,7 +872,11 @@ def add_authors_and_social_img_to_blog_posts(website_dir: Path) -> None:
""" # Generate authors HTML - authors_html = construct_authors_html(authors_list, all_authors_info) + authors_html = ( + construct_authors_html(authors_list, all_authors_info) + if '
' not in content + else "" + ) # Combine content new_content = f"{front_matter_string}\n{social_img_html}\n{authors_html}\n{content}"