updates
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{% block content %}
|
||||
<div class="container mt-4 mb-5">
|
||||
{% if content_item.image_file %}
|
||||
<img src="{{ parent_path }}static/images/{{ content_item.image_file }}" alt = "content_item.image_file" class="img-fluid mb-5 rounded w-100 h-auto">
|
||||
<img src="{{ parent_path }}static/images/{{ content_item.image_file }}" alt="{{ content_item.image_file }}" class="img-fluid mb-5 rounded w-100 h-auto dotr">
|
||||
{% endif %}
|
||||
{% if not content_item.omit_second_title %}
|
||||
<h1>{{ content_item.title }}</h1>
|
||||
|
||||
Reference in New Issue
Block a user