popular blog post rendering an invalid url

Hi
I’m trying to figure out why my Hubl code is resulting in a url error.
I have this code:
{% set pop_posts = blog_popular_posts(‘Named Blog’, 5) %}
{% for pop_post in pop_posts %}
<a class=“post-title d-block mb-3” href=“{{ pop_post.absolute_url }}”>{{ pop_post.name }}</a>
{% endfor %}
The expected output would be something like www.somesite.com/blog/some-article.
What I am getting is www.somesite.com/blog/blog/some-article.

I also tried, pop_post.slug. FYI

Can someone point me in the right direction as to why this isn’t working?

Hey @JErkelens

Welcome to the Community and thank you for sharing this information.

Hey @piersg @stefen @Anton could you please advise @JErkelens?

Thanks

Sharon

Hi @JErkelens,

I’ve tried your code with “Default” as blog and I’m getting the correct URL.
Are you getting the …/blog/blog/… in the module preview or on the “live” page?

If it’s in the live page - could you please check if you have something in the redirects? Maybe there is a /blog/ redirect set which collides. Also you can check your Blog settings(don’t change anything - just check). maybe there’s something wrong too.

If it’s in the preview - could you please post the whole code here?

best,

Anton