rp's Eleventy short codes
caption caption text
Add a centeed caption to a figure or image.
{% caption 'Figure 1a. Markdown example to be indexed' %}
Example:
classProvider className
Inject an empty div tag with a specified class name. This is usually used to apply CSS to the following element.
Used before an Shiki code fence this numbers the code:
{% classProvider 'show-shiki-lines'%}
Used before a table, this makes the table 100% wide with slightly smaller text:
{% classProvider 'table-100'%}
Example: Use dev tools to see the div.warren-zevon element here.
hideContent (paired) title
Hide content unless the user wants to see it.
{% hideContent 'This hides content' %}
.. this content hidden until displayed
{% endhideContent %}
Example:
This hides content
.. this content hidden until displayed
fancySpacer spaceTop (default = 2.5rem) spaceBottom (default = 2rem)
Injects a fancy element to indicate a minor section break.
{% fancySpacer %}
Example:
jumpLink id
Inject an empty div with a specified id to create a jumplink to this location.
{% jumpLink `id` %}
Example: Change url to posts/eleventy-shortcodes#jumplink to see the jumpLink in action.
jumpLinkHeading headingText id headingTag (default = h2)
Inject a heading with the specified headingText, id, and, optionally, headingTag (the default is h2). This creates a jumplink at the heading.
{% jumpLinkHeading `The history of the heading tag` `heading-tag-history` `h3 `%}
Example: Naviage to the heading below with #jump-link-heading.
This is an h2 heading
svg
Returns raw SVG code.
{% svg 'left-arrow' %}
Example: