Skip to content

Commit

Permalink
Merge pull request #139 from stuartmaxwell:update-templates
Browse files Browse the repository at this point in the history
Sidebar only on djpress pages
  • Loading branch information
stuartmaxwell authored Nov 15, 2024
2 parents 636f078 + 8d289bd commit 53c217f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 27 deletions.
21 changes: 3 additions & 18 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,9 @@
{% include "snippets/navbar.html" %}
</header>

<main class="container main-sidebar">
<div>
{% block content %}
{% endblock content %}
</div>
<aside class="hide-at-s">
<nav>
<ul>
<li><strong>Recent Posts</strong></li>
</ul>
<ul>
{% get_recent_posts as posts %}
{% for post in posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</nav>
</aside>
<main class="container {% block main_classes %}{% endblock %}">
{% block content %}
{% endblock content %}
</main>

</body>
Expand Down
25 changes: 25 additions & 0 deletions templates/djpress/stuartmnz/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{% extends 'base.html' %}
{% load djpress_tags %}

{% block main_classes %}main-sidebar{% endblock %}

{% block content %}

<div>
{% block djpress_content %}{% endblock %}
</div>
<aside class="hide-at-s">
<nav>
<ul>
<li><strong>Recent Posts</strong></li>
</ul>
<ul>
{% get_recent_posts as posts %}
{% for post in posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</nav>
</aside>

{% endblock content %}
6 changes: 3 additions & 3 deletions templates/djpress/stuartmnz/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% extends 'djpress/stuartmnz/base.html' %}
{% load djpress_tags %}

{% block content %}
{% block djpress_content %}

{% for post in posts %}

Expand Down Expand Up @@ -46,4 +46,4 @@
{% endif %}


{% endblock content %}
{% endblock djpress_content %}
6 changes: 3 additions & 3 deletions templates/djpress/stuartmnz/page.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% extends 'base.html' %}
{% extends 'djpress/stuartmnz/base.html' %}
{% load djpress_tags %}


{% block content %}
{% block djpress_content %}

<article>
{% post_title outer_tag="h1" %}
{% post_content outer_tag="section" %}
</article>

{% endblock content %}
{% endblock djpress_content %}
6 changes: 3 additions & 3 deletions templates/djpress/stuartmnz/single.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% extends 'base.html' %}
{% extends 'djpress/stuartmnz/base.html' %}
{% load djpress_tags %}


{% block content %}
{% block djpress_content %}

{% include "djpress/stuartmnz/snippets/post_detail.html" %}

{% endblock content %}
{% endblock djpress_content %}

0 comments on commit 53c217f

Please sign in to comment.