Fixed- Adds the cannoical for real now - version 1.1.4
parent
14df158a7a
commit
b0901b7dc7
|
|
@ -681,10 +681,12 @@ class BatchProcessor:
|
||||||
|
|
||||||
# Step 4: Apply templates
|
# Step 4: Apply templates
|
||||||
click.echo(f" Applying templates...")
|
click.echo(f" Applying templates...")
|
||||||
|
url_map = {url_info["content_id"]: url_info["url"] for url_info in article_urls}
|
||||||
template_count = 0
|
template_count = 0
|
||||||
for content in content_records:
|
for content in content_records:
|
||||||
try:
|
try:
|
||||||
if self.generator.apply_template(content.id):
|
canonical_url = url_map.get(content.id)
|
||||||
|
if self.generator.apply_template(content.id, canonical_url=canonical_url):
|
||||||
template_count += 1
|
template_count += 1
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
click.echo(f" Warning: Failed to apply template to content {content.id}: {e}")
|
click.echo(f" Warning: Failed to apply template to content {content.id}: {e}")
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,8 @@ class TemplateService:
|
||||||
formatted_html = formatted_html.replace("{{ meta_description }}", self._escape_html(meta_description))
|
formatted_html = formatted_html.replace("{{ meta_description }}", self._escape_html(meta_description))
|
||||||
formatted_html = formatted_html.replace("{{ content }}", content)
|
formatted_html = formatted_html.replace("{{ content }}", content)
|
||||||
|
|
||||||
if canonical_url:
|
canonical_url_value = canonical_url if canonical_url else ""
|
||||||
formatted_html = formatted_html.replace("{{ canonical_url }}", canonical_url)
|
formatted_html = formatted_html.replace("{{ canonical_url }}", canonical_url_value)
|
||||||
|
|
||||||
return formatted_html
|
return formatted_html
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue