Add phlog prompt to post creation scripts (Phase 4)
All three post creation scripts now ask whether to publish to gopher phlog and include the phlog field in generated frontmatter.
This commit is contained in:
@@ -254,7 +254,7 @@ def prompt_home_details():
|
||||
}
|
||||
|
||||
|
||||
def create_draft_post(movie, tmdb_details, poster_url, viewing_details=None):
|
||||
def create_draft_post(movie, tmdb_details, poster_url, viewing_details=None, phlog=False):
|
||||
"""Create a Hugo draft post for the movie."""
|
||||
slug = slugify(movie["title"])
|
||||
filename = f"{slug}.md"
|
||||
@@ -328,12 +328,14 @@ def create_draft_post(movie, tmdb_details, poster_url, viewing_details=None):
|
||||
- had pizza"""
|
||||
|
||||
# Build the frontmatter and content
|
||||
phlog_str = "true" if phlog else "false"
|
||||
content = f'''---
|
||||
title: '{movie["title"]}'
|
||||
date: {now}
|
||||
draft: true
|
||||
series: "Frank's Couch"
|
||||
summary: ""
|
||||
phlog: {phlog_str}
|
||||
imdb: "{imdb_id}"
|
||||
poster: "{poster_url or ''}"
|
||||
tags:
|
||||
@@ -396,6 +398,10 @@ def import_movie(movie, viewing_mode=None):
|
||||
else:
|
||||
viewing_details = prompt_viewing_details()
|
||||
|
||||
# Ask about gopher phlog
|
||||
phlog_input = input("\nPublish to gopher phlog? (y/N): ").strip().lower()
|
||||
phlog = phlog_input == "y"
|
||||
|
||||
# Get TMDB details
|
||||
print("\n Fetching TMDB details...")
|
||||
tmdb = get_tmdb_details(movie["tmdb_id"])
|
||||
@@ -409,7 +415,7 @@ def import_movie(movie, viewing_mode=None):
|
||||
|
||||
# Create draft post
|
||||
print(" Creating draft post...")
|
||||
filepath = create_draft_post(movie, tmdb, poster_url, viewing_details)
|
||||
filepath = create_draft_post(movie, tmdb, poster_url, viewing_details, phlog)
|
||||
|
||||
if filepath:
|
||||
print(f"\nDone! Edit your draft at: {filepath.relative_to(PROJECT_ROOT)}")
|
||||
|
||||
Reference in New Issue
Block a user