# Detecting whether the current page is /blog/page/N/

**URL:** <https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047>\
**Category:** support\
**Created:** [April 5, 2017, 6:10am UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047 "2017-04-05T06:10:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adiabatic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/adiabatic/32/2913_2.png) [@adiabatic](https://discourse.gohugo.io/u/adiabatic)\
**Post date:** [April 5, 2017, 6:10am UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/1 "2017-04-05T06:10:26Z")

</div>

Trying to port my fancypants breadcrumbs over to Hugo. I’ve managed to filter out spurious parent links elsewhere, but now that I’m adding pagination to the blog portion of my site, I’m stuck. I can understand if I’m asking the wrong question to solve my problem, but nobody seemed to know where these spurious additions come from.

Anyway, if I can detect that the current page is a generated pagination page, I should be OK, but for some reasons .URL is /blog/ on /blog/page/2/. How can I distinguish /blog/ from /blog/page/2/ if .URL, .RelPermalink, and .Permalink are the same for both?

---

<div class="post-metadata">

**Author:** ![budparr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/budparr/32/749_2.png) [@budparr](https://discourse.gohugo.io/u/budparr)\
**Post date:** [April 5, 2017, 12:31pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/2 "2017-04-05T12:31:28Z")

</div>

I don’t have a specific answer to your question, but there are some posts on breadcrumbs here in the forum, and there’s a blog post here with an approach: [https://gohugohq.com/partials/breadcrumb-partial-with-structured-data-in-hugo/](https://gohugohq.com/partials/breadcrumb-partial-with-structured-data-in-hugo/)

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [April 5, 2017, 4:21pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/3 "2017-04-05T16:21:38Z")

</div>

I don’t use pagination with Hugo @adiabatic, but I’m wondering what you get in your template when you use the `.Kind` page variable for each of the pagination pages. This _might_ (untested) help you distinguish when you’re on a pagination page vs a section page. I will try to test later as well…

---

<div class="post-metadata">

**Author:** ![adiabatic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/adiabatic/32/2913_2.png) [@adiabatic](https://discourse.gohugo.io/u/adiabatic)\
**Post date:** [April 5, 2017, 9:35pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/4 "2017-04-05T21:35:24Z")

</div>

Nope. It’s “section” on both /blog/ and /blog/page/2/.

Thanks, though.

---

<div class="post-metadata">

**Author:** ![adiabatic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/adiabatic/32/2913_2.png) [@adiabatic](https://discourse.gohugo.io/u/adiabatic)\
**Post date:** [April 5, 2017, 9:41pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/5 "2017-04-05T21:41:28Z")

</div>

I may yet go back to a URL slice-and-dice; thanks for this.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [April 5, 2017, 9:58pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/6 "2017-04-05T21:58:19Z")

</div>

There currently isn’t any _good_ way of doing it.

There is a catch 22 situation going on here:

1. Pagination pages aren’t created until you create/reference a Paginator in a template.
2. You can do a check for `.Paginator.PageNumber > 1` or something, but then you will create the paginator if not already created, which may be too early or not at all what you want …

We could (and maybe should) add some kind of indicator to the page itself, but that will demand some work … And a GitHub issue.

---

<div class="post-metadata">

**Author:** ![adiabatic](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/adiabatic/32/2913_2.png) [@adiabatic](https://discourse.gohugo.io/u/adiabatic)\
**Post date:** [April 5, 2017, 11:56pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/7 "2017-04-05T23:56:14Z")

</div>

[Issue #3287](https://github.com/spf13/hugo/issues/3287) submitted.

Thanks!

---

<div class="post-metadata">

**Author:** ![zabatonni](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zabatonni/32/7942_2.png) [@zabatonni](https://discourse.gohugo.io/u/zabatonni)\
**Post date:** [July 24, 2020, 12:47pm UTC](https://discourse.gohugo.io/t/detecting-whether-the-current-page-is-blog-page-n/6047/8 "2020-07-24T12:47:40Z")

</div>

Hello,

any changes on this issue? I’m creating paginator later/deeper in template, but need to have info about it in header.
