From 22e279e2bc0bab3b101487ad458d0a00fa438624 Mon Sep 17 00:00:00 2001 From: Awiteb Date: Mon, 26 Aug 2024 03:32:12 +0000 Subject: [PATCH] chore: Update index preview when update an article Signed-off-by: Awiteb --- scripts/article.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/article.py b/scripts/article.py index ec4cc56..7b8df92 100755 --- a/scripts/article.py +++ b/scripts/article.py @@ -128,6 +128,7 @@ def update_header( header_value = f'"{header_value}"' article.headers[header_scope][header_name] = header_value article.export() + os.system("shot-scraper --silent 'http://127.0.0.1:1111/' -w 700 -h 400 --retina --quality 60 -o static/img/social_cards/index.jpg") print("The header has been updated successfully.") @@ -136,8 +137,8 @@ def create_new_article(article_name: str) -> None: if os.path.exists(article.path): print(f"The article {article_name} already exists.") sys.exit(1) - article.headers["global"]["title"] = '""' - article.headers["global"]["description"] = '""' + article.headers["global"]["title"] = '"Title"' + article.headers["global"]["description"] = '"Description"' article.headers["global"]["date"] = now() article.headers["global"]["updated"] = now() article.headers["global"]["draft"] = "true"