Skip to content

Commit

Permalink
aider: Fixed title block definitions in base.html and page.html templ…
Browse files Browse the repository at this point in the history
…ates to resolve rendering issue.

# Aider chat conversation:

USER: Error: Reason: Failed to render 'page.html' (error happened in a parent template)

ASSISTANT: To address the error "Failed to render 'page.html' (error happened in a parent template)", we need to ensure that the `page.html` template correctly extends `base.html` and that all necessary variables are passed correctly.

Let's start by making sure that `page.html` correctly extends `base.html` and that the `base.html` template is correctly structured.

Here are the *SEARCH/REPLACE* blocks:

templates/page.html
```python
<<<<<<< SEARCH
{% block content %}
=======
{% block title %}{{ page.title }}{% endblock %}

{% block content %}
>>>>>>> REPLACE
```

templates/base.html
```python
<<<<<<< SEARCH
  <title>{% block title %}{{ title }}{% endblock %}</title>
=======
  <title>{% block title %}{% endblock %}</title>
>>>>>>> REPLACE
```

These changes ensure that the `title` block is correctly defined in `base.html` and overridden in `page.html`. This should help resolve the rendering issue.
  • Loading branch information
sanity committed Jun 12, 2024
1 parent ce16088 commit fe20bfd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
<meta charset="utf-8">
<title>{% block title %}{{ title }}{% endblock %}</title>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="/css/bulma.min.css" />
<link rel="stylesheet" href="/css/freenetorg.css" />
</head>
Expand Down
2 changes: 2 additions & 0 deletions templates/page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% block title %}{{ page.title }}{% endblock %}

{% block content %}
<article class="content">
<h1 class="title">{{ page.title }}</h1>
Expand Down

0 comments on commit fe20bfd

Please sign in to comment.