Hey there, Forem Creators!
While you may be technical and understand what liquid tags are, it's very possible that your Forem will have members from all backgrounds and a simple "follow along" guide might help them.
Getting Started
You've likely noticed that when you click "Create Post" your Forem automatically provides a Markdown Guide and also a Liquid Tag guide, also located here {your-forem-url.tld}/new#liquid
Note: that the "Editor Basics" information only shows up if the cursor focus is on the body editor, if you don't see it just click where you would type in the content of the post.
Let's Embed a Video
Embedding with YouTube might be one of the more common use cases for liquid tags. Let's find a video and share the link!
We'll be using a video from GitHub about Forem but instead of sending it as a link where you'd have to go to YouTube to watch it, you can display it inside your post!
If you looked through the Liquid tags list, you'd come across "Video Embed" section:
You'll notice that there are two arguments that you need to provide
{% provider identifier %}
provider
- the service you want to use
identifier
- the id of the video found on their platform
In our case, we'd look at the link on YouTube and copy the videos unique id:
Our final use would look like this:
{% youtube YugO6TPC_tc %}
How cool is that!?
You've successfully created your first liquid tag and shared a video - awesome job!
Top comments (4)
I love liquid tags 💚
Here is how you can embed Spotify content in your posts:
Spotify track example:
https://open.spotify.com/track/2Nc1v8I86FUGorwjXKo0in
Its important to note that Spotify liquid tags require you to enter the
provider
twice.{% spotify spotify:track:2Nc1v8I86FUGorwjXKo0in %}
Spotify podcast episode example:
https://open.spotify.com/episode/3XVJAUAoGQ3vrXQe6idaNo
{% spotify spotify:episode:3XVJAUAoGQ3vrXQe6idaNo %}
The Spotify embed really is awesome. Also, great song choice with "Die For It" 🙌
Awesome post!
My favorite video embed has gotta be
{% youtube dQw4w9WgXcQ %}
which translates to:Amazing!