diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-09-24 17:06:26 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-09-24 17:06:26 +0200 |
commit | d80c9fe69b35cf47bfd13b628c379c55d468c6fc (patch) | |
tree | 18cc35268a6e67ca7dcae4ec7039de4f5eea4b9c /talermerchantdemos/blog/content.py | |
parent | 22c3bfee9148e1836817ef00b4829a8385570c69 (diff) | |
download | taler-merchant-demos-d80c9fe69b35cf47bfd13b628c379c55d468c6fc.tar.gz taler-merchant-demos-d80c9fe69b35cf47bfd13b628c379c55d468c6fc.tar.bz2 taler-merchant-demos-d80c9fe69b35cf47bfd13b628c379c55d468c6fc.zip |
Nora CSS and build system updates
Diffstat (limited to 'talermerchantdemos/blog/content.py')
-rw-r--r-- | talermerchantdemos/blog/content.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/talermerchantdemos/blog/content.py b/talermerchantdemos/blog/content.py index 23fb77f..8de89f4 100644 --- a/talermerchantdemos/blog/content.py +++ b/talermerchantdemos/blog/content.py @@ -96,9 +96,8 @@ def add_from_html(resource_name, lang): title_el = soup.find("h2") if title_el is None: LOGGER.warning("Cannot extract title from '%s'", resource_name) - title = resource_name - else: - title = title_el.get_text().strip() + return + title = title_el.get_text().strip() slug = title.replace(" ", "_") slug = re.sub(r'[^a-zA-Z0-9_]+', "-", slug) @@ -142,4 +141,5 @@ for l in listdir(resource_filename("talermerchantdemos", "blog/articles/")): if l in {"en", "ar", "zh", "fr", "hi", "it", "ja", "ko", "pt", "pt_BR", "ru", "tr", "de", "sv", "es"}: LOGGER.info("importing %s" % l) for a in listdir(resource_filename("talermerchantdemos", "blog/articles/" + l)): - add_from_html("blog/articles/" + l + "/" + a, l) + if os.path.isfile(resource_filename("talermerchantdemos", "blog/articles/" + l + "/" + a)): + add_from_html("blog/articles/" + l + "/" + a, l) |