Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit gemfile, fix pagination page 1 #3

Merged
merged 1 commit into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ group :jekyll_plugins do
gem 'jekyll-seo-tag'
gem 'jekyll-archives'
gem 'kramdown'
gem "kramdown-parser-gfm"
gem 'rouge'
end
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ GEM
listen (~> 3.0)
kramdown (2.3.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
Expand Down Expand Up @@ -75,7 +77,8 @@ DEPENDENCIES
jekyll-seo-tag
jekyll-sitemap
kramdown
kramdown-parser-gfm
rouge

BUNDLED WITH
2.0.1
2.1.4
4 changes: 3 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ jekyll-archives:
category: '/category/:name/'

# Pagination
paginate: 20
paginate: 9
paginate_trail: 2
paginate_show_first_and_last: true
paginate_path: /page:num/

# Other
Expand Down
39 changes: 26 additions & 13 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
{% if paginator.total_pages > 1 %}
<div class="pagination">
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-center flex-wrap">

{% if paginator.previous_page %}
<a class="ml-1 mr-1" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
{% else %}
<span>&laquo; Prev</span>
{% if site.paginate_show_first_and_last %}
<li class="page-item"><a class="page-link" href="{{ site.baseurl | replace: '//', '/' }}/" title="First page">&laquo;</a></li>
{% endif %}
<li class="page-item"><a class="page-link" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}" title="Previous page">&lt;</a></li>
{% endif %}

{% for page in (1..paginator.total_pages) %}
{% if page == paginator.page %}
<span class="ml-1 mr-1">{{ page }}</span>
{% assign page_start = paginator.page | minus: site.paginate_trail %}
{% assign page_end = paginator.page | plus: site.paginate_trail %}

{% for page in (page_start..page_end) %}
{% if page < 1 %}
<!-- Do nothing -->
{% elsif page > paginator.total_pages %}
<!-- Do nothing -->
{% elsif page == paginator.page %}
<li class="page-item active"><a class="page-link">{{ page }} <span class="sr-only">(current)</span></a></li>
{% elsif page == 1 %}
<a class="ml-1 mr-1" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">{{ page }}</a>
<li class="page-item"><a class="page-link" href="{{ site.baseurl | replace: '//', '/' }}/">{{ page }}</a></li>
{% else %}
<a class="ml-1 mr-1" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
<li class="page-item"><a class="page-link" href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a></li>
{% endif %}
{% endfor %}

{% if paginator.next_page %}
<a class="ml-1 mr-1" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
{% else %}
<span>Next &raquo;</span>
<li class="page-item"><a class="page-link" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}" title="Next page">&gt;</a></li>
{% if site.paginate_show_first_and_last %}
<li class="page-item"><a class="page-link" href="{{ site.baseurl | replace: '//', '/' }}/page{{ paginator.total_pages }}" title="Last page">&raquo;</a></li>
{% endif %}
{% endif %}
</div>

</ul>
</nav>
{% endif %}
41 changes: 35 additions & 6 deletions assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,43 @@
display:inline;
}

figcaption {
text-align: center;
font-size: smaller;
color: #757575;
}

// Import partials from `sass_dir` (defaults to `_sass`)
@import
"syntax",
"starsnonscss"
;

/* pagination */

$paginateColor: #00ab6b;

.pagination > li > a
{
background-color: white;
color: $paginateColor;
}

.pagination > li > a:focus,
.pagination > li > a:hover,
.pagination > li > span:focus,
.pagination > li > span:hover
{
color: #5a5a5a;
background-color: #eee;
border-color: #ddd;
}

.pagination > .active > a
{
color: white;
background-color: $paginateColor !important;
border: solid 1px $paginateColor !important;
z-index: 0 !important;
}

.pagination > .active > a:hover
{
background-color: $paginateColor !important;
border: solid 1px $paginateColor;
}
/* pagination end */
2 changes: 2 additions & 0 deletions assets/css/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -754,9 +754,11 @@ span.navigation {
text-align: center;
}

/*
.pagination {
display: block;
}
*/

iframe {
max-width: 100%;
Expand Down