Shortcode Examples

Shortcode Examples

Darklane includes several custom shortcodes to enhance your content beyond standard Markdown.

This post demonstrates the alert, highlight, details, img, tab, tabgroup, table, and youtube shortcodes.

Alert Shortcodes

Alerts come in several types for different purposes:

info
This is an informational alert. Great for sharing helpful info.
note
This is a note alert. Use it for general observations or side notes.
warning
This is a warning alert. Use it to caution readers about potential issues.
success
This is an success alert. Perfect for highlighting achievements.
error
This is an error alert. Perfect for highlighting mistakes to avoid.
important
This is an important alert. Use it for critical information.

You can also create unlabeled alerts:

This is a simple alert without a label, useful for general callouts.

alert types:

  • info
  • note
  • warning
  • success
  • error
  • important
  • (empty) - no label

Highlight Shortcodes

Highlights are similar to alerts but with different styling:

info
Highlights are great for key takeaways and important points.
note
Highlights are great for sharing key takeaways and notes.
warning
e careful with this approach in production environments.
success
Your configuration is working correctly!
error
This operation cannot be reversed.
important
Always backup your data before proceeding.

highlight types

  • info
  • note
  • warning
  • success
  • error
  • important

Details (Collapsible Sections)

Use details for optional information that readers can expand:

Click to see technical details

Here’s some detailed technical information that most readers might not need. By hiding it in a collapsible section, you keep the main content focused while still providing depth for interested readers.

You can include any Markdown content here:

  • Lists
  • Code blocks
  • Formatted text
Configuration example
theme: darklane
params:
  author: Your Name
  description: Your site description

Tab Groups

Tab groups let you show related content in different formats:

def hello():
    print("Hello, world!")
function hello() {
  console.log("Hello, world!");
}
package main

import "fmt"

func main() {
    fmt.Println("Hello, world!")
}

Images with Captions

The image shortcode provides consistent styling and optional captions:

{{< img src="images/photo.jpg" caption="A beautiful landscape" >}}

You can also control the width:

{{< img src="images/photo.jpg" width="600" caption="Smaller image" >}}

Colored Tables

Use the table shortcode to add a little color to your table headers:

LanguageTypeFirst Release
PythonInterpreted1991
JavaScriptInterpreted1995
GoCompiled2009
RustCompiled2010

Colors

  • info
  • note
  • warning
  • success
  • error
  • important

YouTube Embeds

Embed YouTube videos easily:

{{< youtube "VIDEO_ID" title="Video Title" >}}

These shortcodes help you create professional, informative content without writing custom HTML.