Testing New Shortcodes

Today, I’m just testing out a few new Hugo shortcodes I added to the site. I’ve culled these from around the internet, and hacked together some of my own. You might find them useful, if you’re doing static blogging yourself. You can find all the code on the repo for this site, found here. As I do more and more blogging from the static site generator, this sort of thing will be more and more useful to me, at least.

Here is a link to my legacy philosophy blog, that will open in a new tab. Out of the box, neither markdown, nor Hugo will do this: Exiting The Cave

Here is a quote block, in which I can change text color arbitrarily using a custom span shortcode. Again, out of the box, neither markdown nor Hugo will do this.

A Title
  first         @ some red text
  second        @ some orange text
  third         @ some highlighted green text
  fourth        @ some blue text
  last          @ bold black text

Here is a shortcode for when I want to highlight a line as if I had a marker, and another for when I want to strikeout a passage. This first passage uses the shortcode to strikethrough:

Stephen, archbishop of Canterbury, primate of all England, and cardinal of the holy Roman Church, Henry archbishop of Dublin, William bishop of London, Peter bishop of Winchester, Jocelin bishop of Bath and Glastonbury, Hugh bishop of Lincoln, Walter bishop of Worcester, William bishop of Coventry, Benedict bishop of Rochester, Master Pandulf subdeacon and member of the papal household, Brother Aymeric master of the knighthood of the Temple in England, William Marshal earl of Pembroke, William earl of Salisbury, William earl of Warren, William earl of Arundel, Alan of Galloway constable of Scotland, Warin fitz Gerald, Peter fitz Herbert, Hubert de Burgh seneschal of Poitou, Hugh de Neville, Matthew fitz Herbert, Thomas Basset, Alan Basset, Philip Daubeny, Robert de Roppeley, John Marshal, John fitz Hugh, and other loyal subjects: (1) FIRST, THAT WE HAVE GRANTED TO GOD, and by this present charter have confirmed for us and our heirs in perpetuity, that the English Church shall be free, and shall have its rights undiminished, and its liberties unimpaired.

And this passage uses the standard markdown double-tilde to strike through, but the same highlighter:

That we wish this so to be observed, appears from the fact that of our own free will, before the outbreak of the present dispute between us and our barons, we granted and confirmed by charter the freedom of the Church’s elections - a right reckoned to be of the greatest necessity and importance to it - and caused this to be confirmed by Pope Innocent III. This freedom we shall observe ourselves, and desire to be observed in good faith by our heirs in perpetuity. TO ALL FREE MEN OF OUR KINGDOM we have also granted, for us and our heirs for ever, all the liberties written out below, to have and to keep for them and their heirs, of us and our heirs

Here’s youtube video:

A bitchute video:

An odysee video:

A gist:

An Anchor Podcast:

MP3 Audio Player:

I’m not really sure I see a need for the strikethrough shortcode. But maybe there are instances when the double-tilde causes problems? Here’s a shortcode that will put the current year into this box: [ 2021 ]. That’s nifty, but again, not sure why I would need that. Maybe for a copyright notice?

So far, all of this has been done without javascript. I’ve also discovered that syntax highlighting can be done without javascript as well, and good thing, because highlightjs was causing problems for me. So, now, the site is roughly 97% javascript free. The only thing using javascript is the theme framework, in order to enable the menuing (pure-min, and responsive).

As for code, I’ve removed the theme’s highlightjs, and decided to just use the built-in Hugo highlighter, and pygments highlight themes, because it allows me to use standard markdown code fencing:

var x = 5;
var y = 6;
var z = x + y;
document.getElementById("demo").innerHTML = "The value of z is: " + z;

 Share!