Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lesson Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
prace-lessons
Lesson Template
Commits
9de64a06
Commit
9de64a06
authored
8 years ago
by
Greg Wilson
Browse files
Options
Downloads
Patches
Plain Diff
Cleaning up prev/next logic
parent
a56ac2da
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_includes/episode_find_prev_next.html
+0
-14
0 additions, 14 deletions
_includes/episode_find_prev_next.html
_includes/episode_title.html
+24
-3
24 additions, 3 deletions
_includes/episode_title.html
with
24 additions
and
17 deletions
_includes/episode_find_prev_next.html
deleted
100644 → 0
+
0
−
14
View file @
a56ac2da
{% comment %}
Find previous and next episodes (if any).
{% endcomment %}
{% for episode in site.episodes %}
{% if episode.url == page.url %}
{% unless forloop.first %}
{% assign prev_episode = prev %}
{% endunless %}
{% unless forloop.last %}
{% assign next_episode = site.episodes[forloop.index] %}
{% endunless %}
{% endif %}
{% assign prev = episode %}
{% endfor %}
This diff is collapsed.
Click to expand it.
_includes/episode_title.html
+
24
−
3
View file @
9de64a06
{% include episode_find_prev_next.html %}
{% comment %}
Find previous and next episodes (if any).
{% endcomment %}
{% for episode in site.episodes %}
{% if episode.url == page.url %}
{% unless forloop.first %}
{% assign prev_episode = prev %}
{% endunless %}
{% unless forloop.last %}
{% assign next_episode = site.episodes[forloop.index] %}
{% endunless %}
{% endif %}
{% assign prev = episode %}
{% endfor %}
{% comment %}
Display title and prev/next links.
{% endcomment %}
<div
class=
"row"
>
<div
class=
"col-md-1"
>
<h3>
{% if prev_episode %}
<a
href=
"{{ site.github.url }}{{ prev_episode.url }}"
><span
class=
"glyphicon glyphicon-menu-left"
></span></a>
{% els
e
%}
{% els
if site.github.url
%}
<a
href=
"{{ site.github.url }}"
><span
class=
"glyphicon glyphicon-menu-up"
></span></a>
{% else %}
<a
href=
"/"
><span
class=
"glyphicon glyphicon-menu-up"
></span></a>
{% endif %}
</h3>
</div>
...
...
@@ -17,8 +36,10 @@
<h3>
{% if next_episode %}
<a
href=
"{{ site.github.url }}{{ next_episode.url }}"
><span
class=
"glyphicon glyphicon-menu-right"
></span></a>
{% els
e
%}
{% els
if site.github.url
%}
<a
href=
"{{ site.github.url }}"
><span
class=
"glyphicon glyphicon-menu-up"
></span></a>
{% else %}
<a
href=
"/"
><span
class=
"glyphicon glyphicon-menu-up"
></span></a>
{% endif %}
</h3>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment