Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

layout: push out prev/next navigation out of the main layout

  • Loading branch information...
commit 060f5378a3abc54b02cd4172a4f276972abc1614 1 parent 2c1333b
@vincentbernat authored
Showing with 45 additions and 30 deletions.
  1. +20 −30 layout/base.j2
  2. +25 −0 layout/prevnext.j2
View
50 layout/base.j2
@@ -14,7 +14,11 @@
{% block stylesheets %}{% endblock %}
<script src="{{ media_url('js/modernizr.js') }}"></script>
</head>
-<body {% if resource.meta.class is defined %}class="lf-{{ resource.meta.class }}"{% endif %}>
+{% if resource.meta.class is defined %}
+<body class="lf-{{ resource.meta.class }}">
+{% else %}
+<body>
+{% endif %}
{# Navigation bar #}
<nav id="lf-navbar">
@@ -34,7 +38,7 @@
</div>
</nav>
-{% include "sidebar.j2" %}
+ {% include "sidebar.j2" %}
{# Pages #}
<div id="lf-pages">
@@ -43,39 +47,25 @@
<div id="lf-page">
<article>
<header>
-{% block header %}
+ {% block header %}
<h1>{{resource.meta.title}}</h1>
- {% if resource.meta.author != None %}<h2>{{resource.meta.author}}</h2>{% endif %}
-{% from "macros.j2" import resource_date with context %}
-{{ resource_date(resource) }}
-{% endblock %}
+ {% if resource.meta.author != None %}
+ <h2>{{resource.meta.author}}</h2>
+ {% endif %}
+ {% from "macros.j2" import resource_date with context %}
+ {{ resource_date(resource) }}
+ {% endblock %}
</header>
-{% block main %}
+ {% block main %}
<div id="lf-main" role="main">
-{% filter markdown|typogrify -%}
-{% mark article -%}{% block article -%}{%- endblock %}{%- endmark %}
-{%- endfilter %}
+ {% filter markdown|typogrify -%}
+ {% mark article -%}{% block article -%}{%- endblock %}{%- endmark %}
+ {%- endfilter %}
</div>
-{% endblock %}
+ {% endblock %}
</article>
-{% set previous = resource|attr("next_by_time_" + resource.meta.language) %}
-{% set next = resource|attr("prev_by_time_" + resource.meta.language) %}
-{% if previous or next %}
- <nav id="lf-prevnext">
-{% if previous %}
-<div class="lf-prev">
-<a href="{{ content_url(previous.url) }}"><span title="{{ resource.meta.l10n.previous }}" class="lf-sprite lf-sprite-slimbox-left">←</span> {{ previous.meta.title }}</a>
-</div>
-{% endif %}
-{% if next %}
-<div class="lf-next">
-<a href="{{ content_url(next.url) }}">{{ next.meta.title }} <span title="{{ resource.meta.l10n.next }}" class="lf-sprite lf-sprite-slimbox-right">→</span></a>
-</div>
-{% endif %}
-<div style="clear: both">
- </nav>
-{% endif %}
-{% include "comments.j2" %}
+ {% include "prevnext.j2" %}
+ {% include "comments.j2" %}
</div>
</div>
View
25 layout/prevnext.j2
@@ -0,0 +1,25 @@
+{# -*- html -*- #}
+{% set previous = resource|attr("next_by_time_" + resource.meta.language) %}
+{% set next = resource|attr("prev_by_time_" + resource.meta.language) %}
+{% if previous or next %}
+<nav id="lf-prevnext">
+ {% if previous %}
+ <div class="lf-prev">
+ <a href="{{ content_url(previous.url) }}">
+ <span title="{{ resource.meta.l10n.previous }}"
+ class="lf-sprite lf-sprite-slimbox-left">←</span>
+ {{ previous.meta.title }}
+ </a>
+ </div>
+ {% endif %}
+ {% if next %}
+ <div class="lf-next">
+ <a href="{{ content_url(next.url) }}">{{ next.meta.title }}
+ <span title="{{ resource.meta.l10n.next }}"
+ class="lf-sprite lf-sprite-slimbox-right">→</span>
+ </a>
+ </div>
+ {% endif %}
+ <div style="clear: both">
+</nav>
+{% endif %}
Please sign in to comment.
Something went wrong with that request. Please try again.