Shortcode to Add a Strikethrough
Edit 21/02/2023: There’s a much easier way to do this when using markdown, by using a tilde character twice. In your markdown for your post or page, wrap the text in a double ‘squiggle’ character and it will strike it out. See our example below 1 ~~Example~~ Looks like: Example (thanks stp in the comments) Original Post: This is part of our Hugo shortcode series. In this post we wanted to make a quick shortcode to add a strikethrough to some of our text. We use a very similar method to the raw html shortcode, but encompass it with the <strike> element.
Shortcode: Add Raw HTML to Your Posts
There are times that your imagination stretches beyond markdown’s capabilities. When this happens it can be easiest to use HTML with your post, but Hugo doesn’t always like this. If we create a shortcode though we can switch between markdown and html easily.