Skip to content

Commit 2b53347

Browse files
adding pagination
1 parent b70885a commit 2b53347

File tree

7 files changed

+55
-12
lines changed

7 files changed

+55
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
I"�{"source"=>"/home/codeperfectplus/Documents/PyContributors/py-contributors.github.io", "destination"=>"/home/codeperfectplus/Documents/PyContributors/py-contributors.github.io/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title:output_ext"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>["jekyll-sitemap", "jekyll-paginate"], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>nil, "show_dir_listing"=>false, "permalink"=>"date", "paginate_path"=>"/updates/page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge", "syntax_highlighter_opts"=>{:default_lang=>"plaintext", :guess_lang=>true}, "coderay"=>{}}, "paginate"=>1, "url"=>"http://localhost:4000", "site"=>"https://py-contributors.github.io", "description"=>"A open Source community for Python, Machine Learning and Artificial intelligence. Open-source contributions are welcome.", "livereload_port"=>35729, "serving"=>true, "watch"=>true}:ET
1+
I"�{"source"=>"/home/codeperfectplus/Documents/PyContributors/py-contributors.github.io", "destination"=>"/home/codeperfectplus/Documents/PyContributors/py-contributors.github.io/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title:output_ext"}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>["jekyll-sitemap", "jekyll-paginate", "jekyll-feed"], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>nil, "show_dir_listing"=>false, "permalink"=>"date", "paginate_path"=>"/updates/page:num/", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>[1, 2, 3, 4, 5, 6], "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false, "syntax_highlighter"=>"rouge", "syntax_highlighter_opts"=>{:default_lang=>"plaintext", :guess_lang=>true}, "coderay"=>{}}, "paginate"=>3, "url"=>"http://localhost:4000", "site"=>"https://py-contributors.github.io", "description"=>"A open Source community for Python, Machine Learning and Artificial intelligence. Open-source contributions are welcome.", "livereload_port"=>35729, "serving"=>true, "watch"=>true}:ET

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ gem "minima", "~> 2.5"
1616
# If you have any plugins, put them here!
1717
group :jekyll_plugins do
1818
gem "jekyll-feed", "~> 0.12"
19+
gem "jekyll-sitemap"
20+
gem "jekyll-paginate"
1921
end
2022

2123
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
@@ -27,5 +29,3 @@ end
2729

2830
# Performance-booster for watching directories on Windows
2931
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
30-
gem 'jekyll-sitemap'
31-
gem 'jekyll-paginate'

_config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
paginate : 1
2-
paginate_path : "/updates/page:num"
1+
paginate : 5
2+
paginate_path : "/updates/page:num/"
33
url: "https://py-contributors.github.io" # the base hostname & protocol for your site
44
plugins:
55
- jekyll-sitemap
66
- jekyll-paginate
7+
- jekyll-feed
78
site : https://py-contributors.github.io
8-
description : A open Source community for Python, Machine Learning and Artificial intelligence. Open-source contributions are welcome.

_data/contributors.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"sn": 2,
1212
"name": "Shubham Pawar",
1313
"github": "shubham5351",
14-
"email": "shubham5351@gmail.com",
14+
"email": "shubhampawar5351@gmail.com",
1515
"info": "I'm an Data Science Enthusiast with intrest in Machine Learning. Intrested in contributing to open source projects. Skilled in Python Data Science, Machine Learning and Web Development.",
1616
"picture": "shubhampawar"
1717
},

_layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="en">
33
<head>
44
<!-- Required meta tags -->
55
<meta charset="utf-8">

join-us/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ <h3> Connect with community</h3><hr>
3939
<li><a href="https://github.com/py-contributors/" target="_blank"><img class="logo" src="https://raw.githubusercontent.com/DrakeEntity/project-Image/master/github-logo.jpg"> Github</a></li>
4040
<li><a href="https://discord.gg/JfbK3bS" target="_blank"><img class="logo"src="https://raw.githubusercontent.com/DrakeEntity/project-Image/master/discord-logo.png"> Discord</a></li>
4141
</ul>
42-
<h3>Resources to Learn about Opensource : </h3><hr>
42+
<h3>Resources to Learn about Opensource :</h3><hr>
4343
<ul>
4444
<li><a href="https://www.dataschool.io/how-to-contribute-on-github/" target="_blank">How to Contribute on Github</a></li>
4545
<li><a href="https://www.digitalocean.com/community/tutorial_series/an-introduction-to-open-source" target="_blank">Introduction to Opensource</a></li>
4646
</ul>
4747

48-
<div class="text-center"><h2><i class="fas fa-code mr-2"></i>Happy Coding<i class="fas fa-code ml-2"></i></h2> </div>
48+
<h2 class="text-center"><i class="fas fa-code mr-2"></i>Happy Coding<i class="fas fa-code ml-2"></i></h2>

updates/index.html

+45-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,57 @@ <h2 class="bg-dark p-2 text-white txet-center">Open-Source Contribution</h2>
3131
<h3 class="mb-0">Notifications</h3>
3232
</div>
3333
<ul class="list-group list-group-flush">
34-
{% for post in site.posts %}
34+
{% for post in paginator.posts %}
3535
<li class="list-group-item">
3636
<span class="badge badge-danger badge-pill p-2 mr-2 animate__animated animate__pulse animate__infinite"> New !! </span>
37-
<a class="mt-2" href="{{post.url}}">{{post.title}}</a>
37+
<a class="mt-2" href="{{post.url | prepend: site.baseurl}}">{{post.title}}</a>
3838
</li>
3939
{% endfor %}
40+
<!-- pagination -->
41+
{% if paginator.total_pages > 1 %}
42+
<div class="pagination">
43+
{% if paginator.previous_page %}
44+
<a href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; Prev</a>
45+
{% else %}
46+
<span>&laquo; Prev</span>
47+
{% endif %}
48+
49+
{% for page in (2..paginator.total_pages) %}
50+
{% if page == paginator.page %}
51+
<span class="webjeda">{{ page }}</span>
52+
{% else %}
53+
<a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}">{{ page }}</a>
54+
{% endif %}
55+
{% endfor %}
56+
57+
{% if paginator.next_page %}
58+
<a href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">Next &raquo;</a>
59+
{% else %}
60+
<span>Next &raquo;</span>
61+
{% endif %}
62+
</div>
63+
{% endif %}
4064
<li class="list-group-item">Keep an eye out.</li>
4165
</ul>
4266
</div>
4367
</div>
4468
</div> <!--Row Div Close-->
69+
<style>.pagination a, .pagination span {
70+
padding: 7px 18px;
71+
border: 1px solid #eee;
72+
margin-left: -2px;
73+
margin-right: -2px;
74+
background-color: #ffffff;
75+
display: inline-block;
76+
}
77+
78+
.pagination a {
79+
&:hover {
80+
background-color: #f1f1f1;
81+
color: #333;
82+
}
83+
}
84+
85+
.pagination {
86+
text-align: center;
87+
}</style>

0 commit comments

Comments
 (0)