Build the final LinkedIn post text from structured fields.
(post_data: Dict)
| 746 | |
| 747 | |
| 748 | def build_linkedin_post_text(post_data: Dict) -> str: |
| 749 | """Build the final LinkedIn post text from structured fields.""" |
| 750 | parts = [] |
| 751 | |
| 752 | for field in ("hook", "body", "closing"): |
| 753 | value = (post_data.get(field) or "").strip() |
| 754 | if value: |
| 755 | parts.append(value) |
| 756 | |
| 757 | hashtags = [tag.strip() for tag in post_data.get("hashtags", []) if tag.strip()] |
| 758 | if hashtags: |
| 759 | parts.append(" ".join(hashtags[:5])) |
| 760 | |
| 761 | return "\n\n".join(parts) |
| 762 | |
| 763 | |
| 764 | def build_instagram_post_text(post_data: Dict) -> str: |
no test coverage detected