From 869f0eb33d9bd84d04b8c161c5aef7ea06fcdd3f Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 23 Jul 2023 13:08:59 +0200 Subject: [PATCH] chore(scripts): update --- .../spreadsheet_to_resource_mds/update_articles.py | 4 +++- .../spreadsheet_to_resource_mds/update_books.py | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/scripts/spreadsheet_to_resource_mds/update_articles.py b/scripts/spreadsheet_to_resource_mds/update_articles.py index 5b608c2..69b3e2e 100644 --- a/scripts/spreadsheet_to_resource_mds/update_articles.py +++ b/scripts/spreadsheet_to_resource_mds/update_articles.py @@ -34,6 +34,7 @@ article_archive = row[10].lstrip().rstrip() article_series = row[11].lstrip().rstrip() article_seriesnr = row[12].lstrip().rstrip() + article_quote = row[13].lstrip().rstrip() md_file_path = title_to_file_path(article_title, 'articles') if md_file_path == "": @@ -43,7 +44,7 @@ f"---\n" f"layout: page-article\n" f"author: {article_author}\n" - f"title: {article_title}\n" + f"title: \"{article_title}\"\n" f"link: {article_link}\n" f"category: {article_category}\n" f"date: {article_date}\n" @@ -55,6 +56,7 @@ f"archive: {article_archive}\n" f"series: {article_series}\n" f"seriesnr: {article_seriesnr}\n" + f"quote: \"{article_quote}\"\n" f"---\n") with open(md_file_path, 'w') as f: diff --git a/scripts/spreadsheet_to_resource_mds/update_books.py b/scripts/spreadsheet_to_resource_mds/update_books.py index f5e7c1a..1973f8d 100644 --- a/scripts/spreadsheet_to_resource_mds/update_books.py +++ b/scripts/spreadsheet_to_resource_mds/update_books.py @@ -18,11 +18,11 @@ NO_AUTHOR_LINKS = "" for row in books.get_all_values(): - if row[0] == 'Categories': + if row[0] == 'Category': continue - resource_categories = row[0].split(',') - resource_type = row[1].lower() + resource_category = row[0].lower() + resource_atf = row[1].lower() resource_essential = row[2].lower() resource_title = row[3].title().replace(":", ":") resource_subtitle = row[4].replace(":", ":") @@ -45,23 +45,25 @@ resource_description = row[18] resource_goodreads = row[19] - md_file_path = title_to_file_path(resource_title, resource_type) + md_file_path = title_to_file_path(resource_title, "books") if md_file_path == "": continue md_file = ( f"---\n" - f"layout: page-{resource_type}\n" + f"layout: page-books\n" f"title: {resource_title}\n" f"subtitle: {resource_subtitle}\n" + f"atf: {resource_atf}\n" f"essential: {resource_essential}\n" - f"categories: {resource_categories}\n" + f"category: {resource_category}\n" f"authors: {resource_authors}\n" f"authors_twitter: {resource_authors_twitter}\n" f"resource_url: {resource_url}\n" f"amazon_url: {resource_amazon_url}\n" f"wikipedia_url: {resource_wikipedia_url}\n" f"free_url: {resource_free_url}\n" + f"summary_url: {resource_summary}\n" f"{permalink_line}" f"rating_order: {resource_rating_order}\n" f"lesson: {resource_lesson}\n"