Skip to content

Commit

Permalink
convert markdown->plaintext for meta description
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Dec 4, 2024
1 parent 9e405c0 commit 7bf2c97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions daras_ai_v2/meta_content.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import typing

from markdown_it import MarkdownIt

from bots.models import PublishedRun, SavedRun, WorkflowMetadata
from daras_ai_v2.breadcrumbs import get_title_breadcrumbs
from daras_ai_v2.meta_preview_url import meta_preview_url
from daras_ai_v2.tts_markdown_renderer import RendererPlain

if typing.TYPE_CHECKING:
from routers.root import RecipeTabs
Expand Down Expand Up @@ -158,6 +161,7 @@ def meta_description_for_page(
else:
description = metadata.meta_description

description = MarkdownIt(renderer_cls=RendererPlain).render(description)
if not (pr and pr.is_root()) or not description:
# for all non-root examples, or when there is no other description
description += SEP + "AI API, workflow & prompt shared on Gooey.AI."
Expand Down

0 comments on commit 7bf2c97

Please sign in to comment.