Skip to content

Commit

Permalink
Add pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Sep 15, 2023
1 parent da357da commit 7bf5eba
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ There is no startup guide or onboarding process. You are greeted with 6 options

![Stripe activated](/images/reviews/stripe/getting-started/activated.png)


Since Stripe is mainly a payment gateway with many features such as Stripe Billing. The onboarding process isn’t as smooth as others since it’s not as clear how you intend to use it as it is with other products.

## Conclusion
Expand Down
3 changes: 2 additions & 1 deletion hugo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
baseURL = 'http://billabear.com'
languageCode = 'en-us'
title = 'BillaBear'
theme = 'billabear'
theme = 'billabear'
paginate=5
42 changes: 36 additions & 6 deletions themes/billabear/layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@

<div class="col-sm-8">
<h1> {{ .Title }}</h1>
<section class="article">


{{ range first 5 .Pages }}
<a href="{{ .Permalink }}" class="title"><h2 class="article-title">{{ .Title }}</h1></a>
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}

{{ range $paginator.Pages }}
<section class="article">
<a href="{{ .Permalink }}" class="title"><h2 class="article-title">{{ .Title }}</h1></a>

<div>
<article id="content">
Expand All @@ -22,8 +23,37 @@ <h1> {{ .Title }}</h1>
</div>
</section>

{{ end }}

{{ end }}
{{ if gt $paginator.TotalPages 1 }}
<div class="pagination">

{{ with $paginator.First }}
<!-- if you prefer characters instead use the following line -->
<!-- <a href="{{ .URL }}" aria-label="First" class="label-pagination"><span aria-hidden="true">&laquo;&laquo;</span></a> -->
<!-- fa-lg is supposedly dynamic size. You can use fa-1x to fa-5x and probably even more, check http://fontawesome.io -->
<a href="{{ .URL }}" aria-label="First" class="label-pagination"><i class="fa fa-angle-double-left fa-lg"></i></a>
{{ end }}

{{ if $paginator.HasPrev }}
<a href="{{ if $paginator.HasPrev }}{{ $paginator.Prev.URL }}{{ end }}" aria-label="Previous" class="label-pagination"><i class="fa fa-angle-left fa-lg"></i></a>
{{ end }}

{{ range $paginator.Pagers }}
<a href="{{ .URL }}" class="label-pagination">{{ .PageNumber }}</a>
{{ end }}

{{ if $paginator.HasNext }}
<a href="{{ if $paginator.HasNext }}{{ $paginator.Next.URL }}{{ end }}" aria-label="Next" class="label-pagination"><i class="fa fa-angle-right fa-lg"></i></a>
{{ end }}

{{ with $paginator.Last }}
<!-- <a href="{{ .URL }}" aria-label="Last"><span aria-hidden="true" class="label-pagination">&raquo;&raquo;</span></a> -->
<a href="{{ .URL }}" aria-label="Last"><i class="fa fa-angle-double-right fa-lg"></i></a>
{{ end }}

</div>
{{ end }}

</div>
<div class="col-sm-4">

Expand Down
7 changes: 6 additions & 1 deletion themes/billabear/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,13 @@ html {
}
}

.pagination {

margin-bottom: 25px;
}

.article {
margin-bottom: 25px;;
margin-bottom: 25px;
}

.article-title {
Expand Down

0 comments on commit 7bf5eba

Please sign in to comment.