Removing links in summary

Hi, I’m using Hugo 0.142.0 on Ubuntu.

I started having a strange formatting issue on my home page, and I noticed that the problem is that the page summary is displayed with a link. When there is no link in the summary, everything works fine.
I noticed that each post is presented inside a div card that is a link to the article. So, when a second tag shows up in the article summary, the browser inserts a before it, breaking the design.

Now, I’m manually adding the summary without the link in the page header. Is there an automatic way of doing so, like displaying the summary but without any links?

Example article with the current fix:

title: “Batteries in Series”
date: 2025-01-29T18:04:18+01:00
lastmod: 2025-01-29T18:04:18+01:00
author: Nilo Menezes
avatar: /media/img/nilo_avatar.jpg
cover: /media/img/content/posts/bseries/4serie_600.png
draft: true
slug: batteries-in-series
summary: “Now that you know how to measure voltage using a multimeter, let’s discover how batteries behave when connected in series!”

Now that you know how to measure voltage using a multimeter, let’s discover how batteries behave when connected in series! :battery::zap:

Batteries in series are those connected one after another, so that the total voltage is the sum of each battery’s voltage.

Site:

Is there a way to make it work automatically? How can I remove the links from the summary without manually specifying the summary every time?

Best Regards,

Nilo Menezes

Pass it through the transform.Plainify function.

Thank you, I will give a try with it. But it removes all html, not only links. Sometimes I have articles with nice html, so they are presented as a miniature in the main page (like bullet marks, etc). Maybe the answer is to develop a custom function do this filtering?

1 Like

I’ve written about this before, but I firmly believe that a page description, teaser, and summary are three very different things. If I were you I would control them separately in front matter, or at least use a manual summary splitter.

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