added podcast and audio shortcodes

This commit is contained in:
Greg Gauthier 2021-04-11 12:26:43 +01:00
parent 8194c15215
commit 0d71deaa43
3 changed files with 25 additions and 1 deletions

View File

@ -3,7 +3,6 @@ title: "Testing New Shortcodes"
date: 2021-04-10T11:27:58+01:00
draft: false
---
{{< time.inline >}}{{ now }}{{< /time.inline >}}
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, **{{< newtab title="found here." url="https://gitea.gmgauthier.com/gmgauthier/personal-blog" >}}** 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.
@ -42,6 +41,25 @@ A gist:
{{< gist gmgauthier 183a5ff2116f8a8feafc64a3363d09db >}}
An Anchor Podcast:
{{< anchor exitingthecave "Short-Reads-The-Consolation-of-Philosophy--Book-4--Chapter-3---What-Good-and-Evil-Deserve-eo17qb" >}}
MP3 Audio Player:
{{< audio "https://soundbible.com/mp3/UFO_Takeoff-Sonidor-1604321570.mp3" >}}
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: [ {{< year >}} ]. 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:
```js
var x = 5;
var y = 6;
var z = x + y;
document.getElementById("demo").innerHTML = "The value of z is: " + z;
```
Latest Build Time: {{< time.inline >}}{{ now }}{{< /time.inline >}}

View File

@ -0,0 +1 @@
<center><iframe src="https://anchor.fm/{{ index .Params 0 }}/embed/episodes/{{ index .Params 1 }}" height="95px" width="425px" frameborder="0" scrolling="no"></iframe></center>

View File

@ -0,0 +1,5 @@
<div><center>
<audio controls>
<source src="{{ index .Params 0 }}" type="audio/mpeg">
</audio>
</center><div>