From baabb819588562390013caca3656a08dfca6d519 Mon Sep 17 00:00:00 2001 From: Yax <1949284+kianby@users.noreply.github.com> Date: Wed, 28 Aug 2019 13:11:04 +0200 Subject: [PATCH] fix summary --- makesite.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/makesite.py b/makesite.py index e950e19..ae18b66 100755 --- a/makesite.py +++ b/makesite.py @@ -142,11 +142,18 @@ def read_content(filename): # Convert Markdown content to HTML. if filename.endswith((".md", ".mkd", ".mkdn", ".mdown", ".markdown")): + summary_index = text.find("', '') text = markdown(clean_text) + else: + summary = truncate(text) # Update the dictionary with content and RFC 2822 date. - content.update({"content": text, "rfc_2822_date": rfc_2822_format(content["date"])}) + content.update({"content": text, "rfc_2822_date": rfc_2822_format(content["date"]), "summary": summary}) return content @@ -230,12 +237,6 @@ def make_posts( page_params["categories"] = categories page_params["category_label"] = "".join(out_cats) - summary_index = page_params["content"].find("