add footer to note that this post was published on medium
authorxangelo <me@xangelo.ca>
Mon, 21 Jul 2025 19:15:51 +0000 (15:15 -0400)
committerxangelo <me@xangelo.ca>
Mon, 21 Jul 2025 19:15:51 +0000 (15:15 -0400)
.github/scripts/medium_to_hugo.py

index 785355baaa3b84dca44eeeb990e80ee77db39c4a..6840df66a1f2cdc943ebaf1e75d11cbbe1ba29b1 100644 (file)
@@ -30,6 +30,9 @@ for entry in feed.entries:
     post["draft"] = False
     post["medium_link"] = entry.link
 
+    # add a line to the bottom of the post to indicate that it's from Medium
+    post["content"] += "\n\n---\n\nThis was originally published on Medium - " + entry.link
+
     output_path = os.path.join(OUTPUT_DIR, f"{slug}.md")
     with open(output_path, "w", encoding="utf-8") as f:
         f.write(frontmatter.dumps(post))