Skip to content

Commit

Permalink
Merge pull request #1524 from Lucif3r-in/fix/blogpage
Browse files Browse the repository at this point in the history
fix: remove permalink to fix pagination bug
  • Loading branch information
leecalcote authored Dec 11, 2023
2 parents 240e9cc + 3083d08 commit a2aeada
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 49 deletions.
53 changes: 22 additions & 31 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ disqus_shortname:
# Values for the jekyll-seo-tag gem (https://github.com/jekyll/jekyll-seo-tag)
logo: /assets/images/logos/meshery-gradient.png
description: The extensible cloud native manager. Confidently wrangle cloud native infrastructure with Meshery.
author:
author:
name: The Meshery Authors
email: [email protected]
twitter: mesheryio
Expand Down Expand Up @@ -46,21 +46,21 @@ collections:
pages:
output: true
programs:
output: true
output: true
catalog:
output: true
sort_by: patternId
# permalink: /:collection/:path/:title

paginate: 10
paginate: 5
paginate_path: "/blog/:num/"
permalink: pretty

# # Site configuration for the Jekyll 3 Pagination Gem
# # The values here represent the defaults if nothing is set
# pagination:
# # Site-wide kill switch, disabled here it doesn't run at all

# # Site-wide kill switch, disabled here it doesn't run at all
# enabled: true

# # Set to 'true' to enable pagination debugging. This can be enabled in the site config or only for individual pagination pages
Expand All @@ -74,15 +74,15 @@ permalink: pretty

# # The permalink structure for the paginated pages (this can be any level deep)
# permalink: '/page/:num/' # Pages are index.html inside this folder (default)
# #permalink: '/page/:num.html' # Pages are simple html files
# #permalink: '/page/:num.html' # Pages are simple html files
# #permalink: '/page/:num' # Pages are html files, linked jekyll extensionless permalink style.

# # Optional the title format for the paginated pages (supports :title for original page title, :num for pagination page number, :max for total number of pages)
# title: ':title - page :num'

# # Limit how many pagenated pages to create (default: 0, means all)
# limit: 0

# # Optional, defines the field that the posts should be sorted on (omit to default to 'date')
# sort_field: 'patternId'

Expand All @@ -95,13 +95,13 @@ permalink: pretty
# # Optional, the default tag to use, omit to disable
# tag: ''

# # Optional, the default locale to use, omit to disable (depends on a field 'locale' to be specified in the posts,
# # Optional, the default locale to use, omit to disable (depends on a field 'locale' to be specified in the posts,
# # in reality this can be any value, suggested are the Microsoft locale-codes (e.g. en_US, en_GB) or simply the ISO-639 language code )
# locale: ''
# locale: ''

# # Optional,omit or set both before and after to zero to disable.
# # Controls how the pagination trail for the paginated pages look like.
# trail:
# # Optional,omit or set both before and after to zero to disable.
# # Controls how the pagination trail for the paginated pages look like.
# trail:
# before: 2
# after: 2

Expand All @@ -116,14 +116,12 @@ permalink: pretty
############################################################

defaults:
-
scope:
- scope:
path: ""
type: "pages"
values:
layout: "plain"
-
scope:
- scope:
path: ""
type: "posts"
values:
Expand All @@ -132,42 +130,36 @@ defaults:
content:
width: 1500
height: 2500
-
scope:
- scope:
path: ""
type: "catalog"
values:
_options:
image:
image:
width: 600
height: 600

-
scope:

- scope:
path: ""
type: "contributors"
values:
_options:
image_path:
width: 600
height: 600
-
scope:
- scope:
path: ""
values:
layout: "page"
-
scope:
- scope:
path: "programs.html"
values:
layout: "default"
-
scope:
- scope:
path: "index.html"
values:
layout: "default"
-
scope:
- scope:
path: "contact.html"
values:
full_width: true
Expand All @@ -176,7 +168,6 @@ jekyll-archives:
enabled:
- categories


exclude:
- Gemfile
- Gemfile.lock
Expand Down
48 changes: 30 additions & 18 deletions blog/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
---
title: Blog
description: Keep up with the latest news.
permalink: /blog
---

<div class="text-container">
<p class="editor-link"><a href="cloudcannon:collections/_posts" class="btn"><strong>&#9998;</strong> Add Post</a></p>
<ul class="blog-posts">
{% include list-posts.html posts=paginator.posts %}
</ul>
<p class="editor-link">
<a href="cloudcannon:collections/_posts" class="btn"
><strong>&#9998;</strong> Add Post</a
>
</p>
<ul class="blog-posts">
{% include list-posts.html posts=paginator.posts %}
</ul>

{% if paginator.total_pages > 1 %}
<!-- Pagination links -->
<div class="pagination">
{% if paginator.previous_page %}
<a href="{% include relative-src.html src=paginator.previous_page_path %}" class="previous btn">&larr; Newer posts</a>
{% endif %}
{% if paginator.total_pages > 1 %}
<!-- Pagination links -->
<div class="pagination">
{% if paginator.previous_page %}
<a
href="{% include relative-src.html src=paginator.previous_page_path %}"
class="previous btn"
>&larr; Newer posts</a
>
{% endif %}

<span class="page_number ">{{ paginator.page }} of {{ paginator.total_pages }}</span>
<span class="page_number"
>{{ paginator.page }} of {{ paginator.total_pages }}</span
>

{% if paginator.next_page %}
<a href="{% include relative-src.html src=paginator.next_page_path %}" class="next btn">Older posts &rarr;</a>
{% endif %}
</div>
{% endif %}

{% if paginator.next_page %}
<a
href="{% include relative-src.html src=paginator.next_page_path %}"
class="next btn"
>Older posts &rarr;</a
>
{% endif %}
</div>
{% endif %}
</div>

0 comments on commit a2aeada

Please sign in to comment.