Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
www
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Marcus
www
Commits
7cc3ac54
Unverified
Commit
7cc3ac54
authored
7 years ago
by
Tom Wiesing
Browse files
Options
Downloads
Patches
Plain Diff
Make pagination look nice
parent
c10be205
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_includes/pagination.html
+53
-52
53 additions, 52 deletions
_includes/pagination.html
index.md
+1
-3
1 addition, 3 deletions
index.md
public/css/main.css
+4
-1
4 additions, 1 deletion
public/css/main.css
with
58 additions
and
56 deletions
_includes/pagination.html
+
53
−
52
View file @
7cc3ac54
<nav
aria-label=
"Page navigation"
>
<ul
class=
"pagination"
>
{% comment %}
Renders a pagination element.
Expects the default jekyll 'paginator' as argument.
{% endcomment %}
<ul
class=
"pagination"
>
<!-- The previous page -->
{% if paginator.previous_page %}
<li>
<a
href=
"{{ site.baseurl }}{{paginator.previous_page_path}}"
aria-label=
"Previous"
>
<
span
aria-hidden=
"true"
>
«
</span
>
</a>
</li>
<li
class=
"waves-effect"
>
<a
href=
"{{ site.baseurl }}{{paginator.previous_page_path}}"
>
<
i
class=
"material-icons"
>
chevron_left
</i
>
</a>
</li>
{% else %}
<li
class=
"disabled"
>
<a
href=
"#"
aria-label=
"Previous"
>
<span
aria-hidden=
"true"
>
«
</span>
</a>
</li>
{% endif %}
{% if paginator.page > 4 %}
<li><a
href=
"{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: 'page:num/', '' }}"
>
1
</a></li>
{% if paginator.page > 5 %}
<li
class=
"disabled"
><a
href=
"#"
>
...
</a></li>
{% endif %}
<li
class=
"disabled"
>
<a
href=
"#!"
>
<i
class=
"material-icons"
>
chevron_left
</i>
</a>
</li>
{% endif %}
{% assign min_index = paginator.page | minus:3 %}
{% assign max_index = paginator.page | plus:3 %}
{% for p in (min_index..max_index) %}
{% if p > 0 and p
<
=
paginator.total_pages
%}
<
li
{%
if
p =
=
paginator.page
%}
class=
"active"
{%
endif
%}
>
{% if p == 1 %}
<a
href=
"{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: 'page:num/', '' }}"
>
1
</a>
{% else %}
<a
href=
"{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', p }}"
>
{{ p }}
</a>
{% endif %}
<!-- Show all the pages -->
{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<li
class=
'active'
>
<a
href=
"#!"
>
{{page}}
</a>
</li>
{% elsif page == 1 %}
<li
class=
"waves-effect"
>
<a
href=
"{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}"
>
{{page}}
</a>
</li>
{% else %}
<li
class=
"waves-effect"
>
<a
href=
"{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}"
>
{{page}}
</a>
</li>
{% endif %}
{% endfor %}
{% if max_index
<
paginator.total_pages
%}
{%
assign
max_indexp =
max_index
|
plus:1
%}
{%
if
max_indexp
<
paginator.total_pages
%}
<
li
class=
"disabled"
><a
href=
"#"
>
...
</a></li>
{% endif %}
<li><a
href=
"{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', paginator.total_pages }}"
>
{{ paginator.total_pages }}
</a></li>
{% endif %}
<!-- The next page -->
{% if paginator.next_page %}
<li>
<a
href=
"{{ site.baseurl }}{{
paginator.next_page_path
}}"
aria-label=
"Next"
>
<
span
aria-hidden=
"true"
>
»
</span
>
</a>
</li>
<li
class=
"waves-effect"
>
<a
href=
"{{ site.baseurl }}{{paginator.next_page_path}}"
>
<
i
class=
"material-icons"
>
chevron_right
</i
>
</a>
</li>
{% else %}
<li
class=
"disabled"
>
<a
href=
"#
"
aria-label=
"Next
"
>
<
span
aria-hidden=
"true"
>
»
</span
>
</a>
</li>
<li
class=
"disabled"
>
<a
href=
"#
!
"
>
<
i
class=
"material-icons"
>
chevron_right
</i
>
</a>
</li>
{% endif %}
</ul>
</nav>
</ul>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
index.md
+
1
−
3
View file @
7cc3ac54
...
...
@@ -14,10 +14,8 @@ This level of markup allows for offering interesting [knowledge management servi
## Recent News ([see all](/news/posts/))
{% for post in site.posts %}
{% if forloop.index < 5 %}
{% for post in site.posts limit:5 %}
{% include post_link.html %}
{% endif %}
{% endfor %}
<p>
©
{{ site.time | date: '%Y' }}. All rights reserved.
</p>
...
...
This diff is collapsed.
Click to expand it.
public/css/main.css
+
4
−
1
View file @
7cc3ac54
...
...
@@ -32,7 +32,10 @@ h1, h2, h3, h4, h5, h6 {
/* background color */
.page-footer
,
nav
,
.side-nav
.collapsible-body
>
ul
:not
(
.collapsible
)
>
li
.active
,
.side-nav.fixed
.collapsible-body
>
ul
:not
(
.collapsible
)
>
li
.active
{
.page-footer
,
nav
,
.side-nav
.collapsible-body
>
ul
:not
(
.collapsible
)
>
li
.active
,
.side-nav.fixed
.collapsible-body
>
ul
:not
(
.collapsible
)
>
li
.active
,
.pagination
li
.active
{
background-color
:
#5B78FD
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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