Tags page rendering problem

Hello ghosts,

I try to create a “tags page” like this one

So I used my index.hbs and tag.hbs page as an example to create my own tags page. My theme is based on an old Casper version, 2 or 3 years old.

As you see, are rendering correctly, but I have some remaining <a/> between

`<a class="post-card-content-link" href="/tag/france/"></a>`

Here is my tags.hbs file:

{{!< default}}
        
<section class="outer">
    <div class="inner posts">
        <div class="post-feed">
                {{#get 'tags' limit='all' include='count.posts' order='count.posts desc'}}
                {{#foreach tags visibility="public"}}
                        {{> "tag-card"}}
                {{/foreach}}
                {{/get}}
       </div>       
    </div>          
</section>

And the partials/tag-card.hbs :

{{!-- This is a partial file used to generate a tag "card"
which templates loop over to generate a list of tags. --}}
                
<article class="post-card {{post_class}} {{#is "home"}}{{#if feature_image}}{{#has index="0"}}post-card-large{{/has}}{{/if}}{{/is}}">
                        
    {{#if feature_image}}
    <a class="post-card-image-link" href="{{url}}">
        {{!-- This is a responsive image, it loads different sizes depending on device
        https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
        <img class="post-card-image"
            srcset="{{img_url feature_image size="s"}} 300w,
                    {{img_url feature_image size="m"}} 600w,
                    {{img_url feature_image size="l"}} 1000w,
                    {{img_url feature_image size="xl"}} 2000w"
            sizes="(max-width: 1000px) 400px, 800px"
            src="{{img_url feature_image size="m"}}"
            alt="{{title}}"
            loading="lazy"
        />
    </a>
    {{/if}}

    <div class="post-card-content">

        <footer class="post-card-meta">
        <a class="post-card-content-link" href="{{url}}">
            <div class="post-card-byline-content">
                <span class="post-card-byline-date">
                        {{name}}
                        {{plural count.posts empty='posts' singular='(% post)' plural='(% posts)'}}
                </span>
            </div>
        </footer>

    </div>{{!--/.post-card-content--}}

</article>

Any idea why ?

You’re missing the closing </a> tag after your </div> here.

1 Like

Awesome, thanks Kevin, it works perfectly now !