Original post is here: eklausmeier.goip.de
This blog is powered by Simplified Saaze. This static site generator allows to embed various external content, like:
- YouTube
- TikTok
- Vimeo
- WordPress Video
This post gives some examples.
Before we show the easy way to embed them, let's just reiterate that you can embed the plain HTML code directly into your Markdown file. The Markdown converter employed by Simplified Saaze is MD4C. And MD4C accepts HTML code in Markdown. Very simple.
1. Twitter tweets. Add below line to frontmatter:
1Twitter: true
The actual code in Markdown is:
[twitter] https://twitter.com/ValaAfshar/status/548891185268666369 [/twitter]
This gives: [twitter] https://twitter.com/ValaAfshar/status/548891185268666369 [/twitter]
Alternatively you could embed below HTML code into your Markdown file:
1<blockquote class="twitter-tweet">
2 <p lang="en" dir="ltr">"The amount of energy necessary to refute BS is an order of magnitude bigger than to produce it."
3 <a href="http://t.co/uuPG1iDslb">pic.twitter.com/uuPG1iDslb</a></p>— Vala Afshar (@ValaAfshar)
4 <a href="https://twitter.com/ValaAfshar/status/548891185268666369?ref_src=twsrc%5Etfw">December 27, 2014</a>
5</blockquote>
6<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
2. YouTube videos. No special tag is required in the frontmatter. In the Markdown file just add:
[youtube] WFKjKPkbzoI [/youtube]
This gives: [youtube] WFKjKPkbzoI [/youtube]
YouTube requires quite some JavaScript. To refrain using all this JavaScript overhead, use below code using YouTube-light (lt
) instead:
[youtubelt] WFKjKPkbzoI [/youtubelt]
This will just show a thumbnail picture. If you want to actually watch the movie, you have to click on the thumbnail.
[youtubelt] WFKjKPkbzoI [/youtubelt]
No flag is required in the frontmatter.
3. TikTok videos. TikTok videos have become very popular in recent years. Embedding these videos in Simplified Saaze is simple. Add below code to your frontmatter:
1TikTok: true
Put below code into your Markdown file:
[tiktok] https://www.tiktok.com/@sumitsinvestmenttakes/video/7296719275937647918 [/tiktok]
This produces: [tiktok] https://www.tiktok.com/@sumitsinvestmenttakes/video/7296719275937647918 [/tiktok]
Alternatively you can embed below HTML code into your Markdown.
1<blockquote class="tiktok-embed"
2 cite="https://www.tiktok.com/@neuroscienceandyou/video/7223065474198818053"
3 data-video-id="7223065474198818053" style="max-width: 605px;min-width: 325px;" >
4 <section><a target="_blank" title="@neuroscienceandyou" href="https://www.tiktok.com/@neuroscienceandyou?refer=embed">@neuroscienceandyou</a></section>
5</blockquote>
4. Vimeo videos. Vimeo has lost of its traction and is currently losing money. Nevertheless, it is easy to embed a Vimeo video. [vimeo] 116679405 [/vimeo]
Alternatively you could embed below HTML code:
1<iframe src="https://player.vimeo.com/video/116679405?h=705f66bf98" width="640" height="360"
2 frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen>
3</iframe>
4<p><a href="https://vimeo.com/116679405">Milonga - Lima Guitar Duo (sesión en vivo)</a>
5from <a href="https://vimeo.com/emedape">Eme</a> on <a href="https://vimeo.com">Vimeo</a>.</p>
5. Wordpress video. Also called Videopress. It seems to be no longer of major relevance. Even Matt Mullenweg doesn't use it on his own website anymore for new posts. Nevertheless, you can easily embed Wordpress videos in Simplified Saaze. Type below code into your Markdown file:
[wpvideo cmA03MuQ w=400 h=224]
Result is: [wpvideo cmA03MuQ w=400 h=224]
No flag is required in the frontmatter.
6. Notes on frontmatter. For Twitter and TikTok you must include special code in the frontmatter, so that the templates in Simplified Saaze can then add the required JavaScript libraries. In the case of Twitter the logic is as below in bottom-layout.php
, one part of the templates.
1<?php if (isset($entry['Twitter'])) { ?>
2 <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
3<?php } ?>
For TikTok the logic is similar.
1<?php if (isset($entry['TikTok'])) { ?>
2 <script async src="https://www.tiktok.com/embed.js"></script>
3<?php } ?>
The reason for all these conditionals is that the JavaScript libraries in question are quite big. So if they are not required, you want to avoid to load them.