How to remove "(Page %)" on Pagination

Hello everyone,

Hope all is well.

I run a PT-BR Ghost blog and I am using the Edge template. I got tired of the infinite scroll pagination and decided to copy a basic pagination from the Liebling template and everything is working alright.

The only problem is that the paged page always renders with the meta-title/title as “(Page %)” in it like “MyBlog (Page 3)”.

I’ve checked and this is coming from the title.js file located on core/frontend/meta/title.js.

How can I update this text or remove entirely only leaving my website meta-title? As the blog is PT-BR it looks wrong to have a EN string “Page” in the title.
I would prefer something more universal like “#2” or even not displaying it at all.

Can somebody help? The best would be a solution that is upgrade-safe.

Thank you very much. Best Regards

“MyBlog (Page 3)” is being output by the {{meta_title}} helper in your theme. You can replace that in your theme to get the title you want. You’ll need to update each page in your template (or wherever meta_title occurs).

Updating the title tag is a little trickier because you need to pass data around your theme. Check out the block/contentFor helper to see how you can get your result.

Thank you for the response Ryan. Is there any way to change the text “Page %” so it becomes more universal like “#%” or " - % " for example?

The one that exists is too much english :smiley:

Thank you.

Yes, but you’ll need to build a custom title helper using contentFor and block for the title tag and then update your h1s as needed, as I mentioned in the last post. You don’t want to edit title.js because that’s part of Ghost’s codebase (and not your theme).

As a jumping off point, for a collection page, for example, you could do:

<h1>{{@site.title}} {{pagination.page}}</h1>

This would render the title: Your Site 2

Thank you very much RyanF.

I should’ve read better the link that you provided. I am sorry.

Best regards

No worries! It can be tricky, so don’t hesitate to follow up if you run into difficulties :smile: