Tag List Page is duplicating entries

I have a list of tags on my blog (https://mnml.blog). After clicking on a tag all items containing that tag are listed but are being duplicated. I think this started when I added a new content type. I have two (posts, river). I think the range function is pulling each item once per content type. I only want to show each item one time. Any help fixing this would be appreciated. The partial for showing the tags is given below.

{{ define "main" }}

    <h1>{{ i18n "tag" | humanize }}: {{ .Title }}</h1>
    <div class="article-info">
        <a href="{{ "tags/" | absURL }}">{{ i18n "toAllTags" | humanize}}</a>
    {{ range .Data.Pages }}
    <article class="post-list">
                <a href="{{ .RelPermalink }}">{{ .Title }}</a>
        <div class="content">
            {{ .Summary }}
        {{ partial "articleInfoFull.html" . }}
<!--         {{ if .Truncated }}
            <div class="read-more">
                <a href="{{ .RelPermalink }}">{{ i18n "readMore" | humanize }}</a>
        {{ end }} -->

    {{ end }}

{{ end }}

You are more likely to receive a prompt and accurate response if you post a link to the public repository for your project.

See https://discourse.gohugo.io/t/requesting-help/9132.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

1 Like


Thank you for the information. Please see above.

1 Like

Here’s what I did, using v0.91.2:

git clone --recurse-submodules https://github.com/jwhevans/mnml.blog
cd mnml.blog/

This generated many warnings:

The “tweet” shortcode will soon require two named parameters: user and id.

But there were no duplicates in tags. For example:

1 Like

Yes, I need to update my tweet shortcodes. I haven’t gotten around to that yet.

I have verified on my local machine (macOS with Hugo v0.91.2). The tags are not duplicated in v0.91.2. My server was running Ubuntu 20.04 and Hugo v0.88.1. After updating Hugo on the server the tags were still duplicated. I deleted the server files and pulled everything fresh from Github. Then I rebuilt with v0.91.2. Now the duplicates are gone. I’m still not sure why this happened. Thanks for the help.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.