Fix generation script for invocation from just

This commit is contained in:
Pascal Le Merrer 2026-01-22 11:39:31 +01:00
parent 36ea0dd3f7
commit 912993f17d
2 changed files with 5 additions and 5 deletions

View file

@ -50,7 +50,7 @@ ssh:
# Create the skeleton for a new issue of the newsletter, and reference it into the home page # Create the skeleton for a new issue of the newsletter, and reference it into the home page
new number: new number:
PYTHONPATH=PWD venv/bin/python ./scripts/create_newsletter.py {{number}} PYTHONPATH=PWD venv/bin/python ./scripts/create_newsletter.py --number={{number}}
# generate HTML email # generate HTML email
mail file: mail file:

View file

@ -36,7 +36,7 @@ parser.add_argument("-n", "--number", required=True, type=int, help="Newsletter
args = parser.parse_args() args = parser.parse_args()
# Load the newsletter template # Load the newsletter template
template = Path("../template/newsletter.md") template = Path("./template/newsletter.md")
content = template.read_text() content = template.read_text()
@ -52,11 +52,11 @@ new_content = set_publication_date_for_pelican(new_content, next_monday)
new_content = set_publication_date_for_seo(new_content, next_monday) new_content = set_publication_date_for_seo(new_content, next_monday)
# Create the new file # Create the new file
destination = Path(f"../content/newsletter/craft-letter-{args.number}.md") destination = Path(f"./content/newsletter/craft-letter-{args.number}.md")
destination.write_text(new_content) destination.write_text(new_content)
# Load the homepage template # Load the homepage template
template = Path("../template/index.md") template = Path("./template/index.md")
content = template.read_text() content = template.read_text()
new_content = set_publication_date_for_pelican(content, next_monday) new_content = set_publication_date_for_pelican(content, next_monday)
@ -68,5 +68,5 @@ for i in reversed(range(args.number)):
new_content += link new_content += link
# Update the index page # Update the index page
destination = Path("../content/pages/index.md") destination = Path("./content/pages/index.md")
destination.write_text(new_content) destination.write_text(new_content)