I have made a change in my theme where I am showing the number of posts in my blog in the blog header section.
{{#get "posts"}}
<header id="blog-header" {{#if @blog.cover_image}} class="has-cover"{{/if}} data-name="{{posts.length}}">
<div class="inner">
<nav id="navigation">
<span class="blog-logo">
<a href="{{@blog.url}}"><img src="{{@blog.logo}}" alt="{{t "Blog Logo"}}" /></a>
</span>
<span id="menu-button" class="nav-button">
<!--<a class="menu-button"><i class="ic ic-menu"></i> Menu</a>-->
<a class="menu-button"><i class="fas fa-bars"></i></a>
</span>
</nav>
<h1 class="blog-name">{{@blog.title}}</h1>
<span class="blog-description">{{@blog.description}}</span>
</div>
</header>
{{/get}}
As shown, above I am getting the posts and storing the length of the list returned by this helper in the data attribute data-name.
I have 16 posts in total. But the posts value does not exceed 15. Please refer Thinking Out Loud to reproduce the same.
Here is the Github reference, https://github.com/sneharamnath/attila