diff --git a/classes.py b/classes.py index 6954b99..c6f9484 100644 --- a/classes.py +++ b/classes.py @@ -25,6 +25,8 @@ class ContentItem: logger.debug(f"Copying {self.image_file} to {image_targetfile}") shutil.copyfile(self.image_file, image_targetfile) self.image_file = f"{self.image_file.stem}.jpg" + else: + self.image_file = False except Exception as e: logger.error(f"Couldn't render image file {self.image_file}: {e}") try: @@ -45,13 +47,13 @@ class ContentItem: except Exception as e: logger.error(f"Couldn't render CSS file {self.css_file}: {e}") try: - if self.js_file and self.js_file.exists(): + if self.js_file and Path(self.js_file).exists(): self.js_file = Path(self.js_file) js_targetfile = Path(f"{config.output_dir}/{config.static_dir}/js/{self.js_file.name}") logger.debug(f"Copying {self.js_file} to {js_targetfile}") shutil.copyfile(self.js_file, js_targetfile) except Exception as e: - logger.error(f"Couldn't render CSS file {self.js_file}: {e}") + logger.error(f"Couldn't render JS file {self.js_file}: {e}") try: with self.target_file.open("w", encoding="utf-8") as f: f.write(config.content_item_template.render(content_item = self, page_title = f"{config.site_name}: {self.title}", parent_path = '../', categories = categories, footer_data = footer_data)) diff --git a/themes/default/templates/content_item.html b/themes/default/templates/content_item.html index 509a821..c7537a5 100644 --- a/themes/default/templates/content_item.html +++ b/themes/default/templates/content_item.html @@ -10,7 +10,7 @@ {% block content %}
{% if content_item.image_file %} - content_item.image_file + {{ content_item.image_file }} {% endif %} {% if not content_item.omit_second_title %}

{{ content_item.title }}