Display an element only on the first page


I have a little problem on my website, it’s for my homepage. On my index.html file (who is my homepage) i have a part (called with a class “top-section”) who displays a tag list and a post highlight. and just after that i have a call to my list page for display my posts.

My problem is, i want my “top-section” display only on the “page one” for example if you go on the page two i don’t want the “top-section”

here you can find my dummy project : https://github.com/hatchan21/Dummy-Blog

If you have some littles ideas for that…

Thank you very much

You can add a check that only displays this top-section on the first page

{{ if eq .Paginator.PageNumber 1 }}
  // show top-section 
{{ end }}

Also, I’ve updated this thread title to better reflect your question


It works perfectly ! thank you very much !