Skip to content

Commit

Permalink
manually override post language
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Oct 29, 2024
1 parent 80e0859 commit 9b7ec84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ def format_author(author, published_at):
images = get_images(content_html, url, blog["home_page_url"])
image = post.get("image", None) or get_image(images)

language = post.get("language", None) or detect_language(content_text)
# optionally remove tag that is used to filter posts
if blog.get("filter", None) and blog.get("filter", "").startswith("tag"):
tag = blog.get("filter", "").split(":")[1]
Expand Down Expand Up @@ -1235,7 +1236,7 @@ def format_author(author, published_at):
"updated_at": updated_at,
"image": image,
"images": images,
"language": detect_language(content_text),
"language": language,
"category": blog.get("category", None),
"reference": reference,
"relationships": relationships,
Expand Down

0 comments on commit 9b7ec84

Please sign in to comment.