congo/docs/shortcodes/index.html

367 lines
35 KiB
HTML
Raw Normal View History

<!doctype html><html lang=en-au dir=ltr class=scroll-smooth data-default-appearance=light data-auto-appearance=true><head>
<meta charset=utf-8>
<meta http-equiv=content-language content="en-au">
<meta name=viewport content="width=device-width,initial-scale=1">
<meta http-equiv=x-ua-compatible content="ie=edge">
<title>Shortcodes &#183; Congo</title>
<meta name=title content="Shortcodes &#183; Congo">
<meta name=description content="A powerful, lightweight theme for Hugo built with Tailwind CSS.">
<link rel=canonical href=https://jpanther.github.io/congo/docs/shortcodes/>
<link type=text/css rel=stylesheet href=/congo/css/main.bundle.min.7e491e1558c65b086695e635e9db249d5315361bfee4f80437e52c6de4349e574ca37dc7016a03592834743207253d95b1e3f765baf352229af5e5a4de412a64.css integrity="sha512-fkkeFVjGWwhmleY16dsknVMVNhv+5PgEN+UsbeQ0nldMo33HAWoDWSg0dDIHJT2VseP3ZbrzUiKa9eWk3kEqZA==">
<script type=text/javascript src=/congo/js/appearance.min.dbca9e2200cf929a23b55442f2ff09361b8d5290147ff1407f89ed3839f0fea13db4e94f5ae6bf2f3de10d322b4bede74b578455e9cc7d5565314d914602c974.js integrity="sha512-28qeIgDPkpojtVRC8v8JNhuNUpAUf/FAf4ntODnw/qE9tOlPWua/Lz3hDTIrS+3nS1eEVenMfVVlMU2RRgLJdA=="></script>
<script defer type=text/javascript id=script-bundle src=/congo/js/main.bundle.min.238e7ce9c541b4e7abb5781ad8e736e849e74890fcb8a26e73ea1845f573b3a0cf91418b20ac4401bdbb57d9c6c009d8f6ec50dad6d44b48f3936aea0f95c391.js integrity="sha512-I4586cVBtOertXga2Oc26EnnSJD8uKJuc+oYRfVzs6DPkUGLIKxEAb27V9nGwAnY9uxQ2tbUS0jzk2rqD5XDkQ==" data-copy=Copy data-copied=Copied></script>
<link rel=apple-touch-icon sizes=180x180 href=/congo/apple-touch-icon.png>
<link rel=icon type=image/png sizes=32x32 href=/congo/favicon-32x32.png>
<link rel=icon type=image/png sizes=16x16 href=/congo/favicon-16x16.png>
<link rel=manifest href=/congo/site.webmanifest>
<meta property="og:title" content="Shortcodes">
<meta property="og:description" content="All the shortcodes available in Congo.">
<meta property="og:type" content="article">
<meta property="og:url" content="https://jpanther.github.io/congo/docs/shortcodes/"><meta property="article:section" content="docs">
<meta property="article:published_time" content="2020-08-11T00:00:00+00:00">
<meta property="article:modified_time" content="2020-08-11T00:00:00+00:00"><meta property="og:site_name" content="Congo">
<meta name=twitter:card content="summary">
<meta name=twitter:title content="Shortcodes">
<meta name=twitter:description content="All the shortcodes available in Congo.">
<script type=application/ld+json>[{"@context":"https://schema.org","@type":"Article","articleSection":"Documentation","name":"Shortcodes","headline":"Shortcodes","description":"All the shortcodes available in Congo.","abstract":"In addition to all the default Hugo shortcodes, Congo adds a few extras for additional functionality.","inLanguage":"en-au","url":"https:\/\/jpanther.github.io\/congo\/docs\/shortcodes\/","author":{"@type":"Person","name":"Congo"},"copyrightYear":"2020","dateCreated":"2020-08-11T00:00:00\u002b00:00","datePublished":"2020-08-11T00:00:00\u002b00:00","dateModified":"2020-08-11T00:00:00\u002b00:00","keywords":["shortcodes","mermaid","icon","lead","docs"],"mainEntityOfPage":"true","wordCount":"906"}]</script>
<meta name=generator content="Hugo 0.92.1">
<meta name=author content="Congo">
<link href=https://twitter.com/ rel=me>
<link href=https://facebook.com/ rel=me>
<link href=https://linkedin.com/ rel=me>
<link href=https://youtube.com/ rel=me>
<script defer type=text/javascript src=/congo/js/mermaid.bundle.1f0d9d765e05c0c0c6a8e70c01da70923366d0c40b26a7c2b0b441bef5ff2b67cebf5a425edcec72e6b31e73538108bf2f1be3ce5d8a5f1e08ccdf84bd076b3b.js integrity="sha512-Hw2ddl4FwMDGqOcMAdpwkjNm0MQLJqfCsLRBvvX/K2fOv1pCXtzscuazHnNTgQi/Lxvjzl2KXx4IzN+EvQdrOw=="></script>
<script defer type=text/javascript src=/congo/js/chart.bundle.45b978f0ad1efeb2ceb65d4bf5fb2601a039a5f623717d7f772dd6e1fa8e2f2075dc9c1a9a57616ddf337efdf734afb96d6c4ce45508707a8156202ae684e37d.js integrity="sha512-Rbl48K0e/rLOtl1L9fsmAaA5pfYjcX1/dy3W4fqOLyB13Jwamldhbd8zfv33NK+5bWxM5FUIcHqBViAq5oTjfQ=="></script>
<link type=text/css rel=stylesheet href=/congo/lib/katex/katex.min.835a7130a5a7a82240e5b4ccc27c345f07b429001f9e3e3bfb5a41d2821232a5458e6f01835bc0dd110d8fe886ba713d8f8cc32cf59b6aeee38ab5b0272b2175.css integrity="sha512-g1pxMKWnqCJA5bTMwnw0Xwe0KQAfnj47+1pB0oISMqVFjm8Bg1vA3RENj+iGunE9j4zDLPWbau7jirWwJyshdQ==">
<script defer src=/congo/lib/katex/katex.min.89e82bf426efc39d2b1b46a0094ff51d4274c3919f953f8bb24d92448d633a3102d794518095bdbcc2c3171205de6071a080c84b8d5f9c434db92643f9684838.js integrity="sha512-iegr9Cbvw50rG0agCU/1HUJ0w5GflT+Lsk2SRI1jOjEC15RRgJW9vMLDFxIF3mBxoIDIS41fnENNuSZD+WhIOA=="></script>
<script defer src=/congo/lib/katex/auto-render.min.640fd13eb028f3c0e5c119e7a0d56a28836740d716111cd12b4dcf0da038188262559bc61485906dd582b1479b3197e45a88677e782c0e35f353a3e890ee231b.js integrity="sha512-ZA/RPrAo88DlwRnnoNVqKINnQNcWERzRK03PDaA4GIJiVZvGFIWQbdWCsUebMZfkWohnfngsDjXzU6PokO4jGw==" onload=renderMathInElement(document.body)></script>
</head>
<body class="flex flex-col h-screen px-6 m-auto text-lg leading-7 bg-neutral text-neutral-900 sm:px-14 md:px-24 lg:px-32 dark:bg-neutral-800 dark:text-neutral max-w-7xl">
<div id=the-top class="absolute flex self-center">
<a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 dark:bg-neutral-600 focus:translate-y-0" href=#main-content><span class="font-bold ltr:pr-2 rtl:pl-2 text-primary-600 dark:text-primary-400">&darr;</span>Skip to main content</a>
</div><header class="flex justify-between py-6 font-semibold sm:items-center sm:py-10 text-neutral-900 dark:text-neutral">
<div>
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:underline-offset-2" rel=me href=/congo/>Congo</a>
</div>
<nav>
<ul class="flex flex-col list-none sm:flex-row">
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:underline-offset-2" href=/congo/docs/ title=Documentation>Docs</a>
</li>
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:underline-offset-2" href=/congo/samples/ title="Content Samples">Samples</a>
</li>
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:underline-offset-2" href=/congo/users/ title=Users>Users</a>
</li>
<li class="mb-1 ltr:text-right rtl:text-left sm:mb-0 ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<a class="hover:underline hover:decoration-primary-500 hover:decoration-2 hover:underline-offset-2" href=https://github.com/jpanther/congo title>GitHub</a>
</li>
<li class="ltr:text-right rtl:text-left ltr:sm:mr-7 ltr:sm:last:mr-0 rtl:sm:ml-7 rtl:sm:last:ml-0">
<button id=search-button class="text-base hover:text-primary-600 dark:hover:text-primary-400" title="Search (/)">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentcolor" d="M505 442.7 405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9.0 208 0S0 93.1.0 208s93.1 208 208 208c48.3.0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9.0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7.0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7.0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>
</span>
</button>
</li>
</ul>
</nav>
</header>
<main id=main-content class="relative grow">
<article>
<header class=max-w-prose>
<ol class="text-sm text-neutral-500 dark:text-neutral-400">
<li class="inline hidden">
<a class="hover:underline hover:decoration-neutral-300 dark:underline-neutral-600" href=/congo/>Welcome to Congo! :tada:</a><span class="px-1 text-primary-500">/</span>
</li>
<li class=inline>
<a class="hover:underline hover:decoration-neutral-300 dark:underline-neutral-600" href=/congo/docs/>Documentation</a><span class="px-1 text-primary-500">/</span>
</li>
<li class="inline hidden">
<a class="hover:underline hover:decoration-neutral-300 dark:underline-neutral-600" href=/congo/docs/shortcodes/>Shortcodes</a><span class="px-1 text-primary-500">/</span>
</li>
</ol>
<h1 class="mt-0 text-4xl font-extrabold text-neutral-900 dark:text-neutral">
Shortcodes
</h1>
<div class="mt-8 mb-12 text-base text-neutral-500 dark:text-neutral-400">
<div class="flex flex-row flex-wrap items-center">
<span title="Reading time">5 mins</span><span class="px-2 text-primary-500">&#183;</span>
<span class=mb-[2px]>
<a href=https://github.com/jpanther/congo/tree/dev/exampleSite/content/docs/shortcodes/index.md class="text-lg hover:text-primary-500" rel="noopener noreferrer" target=_blank title="Edit content">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="edit" class="svg-inline--fa fa-edit fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentcolor" d="M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5.0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1.0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7.0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174 402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7-43.2-43.2c-4.1-4.1-10.8-4.1-14.8.0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"/></svg>
</span>
</a>
</span>
</div>
</div>
</header>
<section class="flex flex-col max-w-full mt-0 prose lg:flex-row dark:prose-invert">
<div class="order-first px-0 lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8 lg:order-last">
<div class="ltr:pl-5 rtl:pr-5 toc lg:sticky lg:top-10">
<details open class="mt-0 overflow-hidden rounded-lg rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 lg:mt-3">
<summary class="block py-1 text-lg font-semibold cursor-pointer rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 text-neutral-800 dark:text-neutral-100 lg:hidden bg-neutral-100 dark:bg-neutral-700">
Table of Contents
</summary>
<div class="py-2 border-dotted ltr:border-l rtl:border-r rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 border-neutral-300 dark:border-neutral-600">
<nav id=TableOfContents>
<ul>
<li><a href=#alert>Alert</a></li>
<li><a href=#badge>Badge</a></li>
<li><a href=#button>Button</a></li>
<li><a href=#chart>Chart</a></li>
<li><a href=#figure>Figure</a></li>
<li><a href=#icon>Icon</a></li>
<li><a href=#katex>Katex</a></li>
<li><a href=#lead>Lead</a></li>
<li><a href=#mermaid>Mermaid</a></li>
</ul>
</nav>
</div>
</details>
</div>
</div>
<div class="min-w-0 min-h-0 max-w-prose">
<p>In addition to all the <a href=https://gohugo.io/content-management/shortcodes/>default Hugo shortcodes</a>, Congo adds a few extras for additional functionality.</p>
<h2 id=alert class="relative group">Alert <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#alert aria-label=Anchor>#</a></span></h2>
<p><code>alert</code> outputs its contents as a stylised message box within your article. It&rsquo;s useful for drawing attention to important information that you don&rsquo;t want the reader to miss.</p>
<p>The input is written in Markdown so you can format it however you please.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>alert</span> <span class=p>&gt;</span>}}
<span class=gs>**Warning!**</span> This action is destructive!
{{<span class=p>&lt;</span> <span class=p>/</span><span class=nt>alert</span> <span class=p>&gt;</span>}}
</code></pre></div><div class="flex px-4 py-3 rounded-md bg-primary-100 dark:bg-primary-900">
<span class="ltr:pr-3 rtl:pl-3 text-primary-400">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="exclamation-triangle" class="svg-inline--fa fa-exclamation-triangle fa-w-18" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentcolor" d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937.0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154.0l239.94 416.028zM288 354c-25.405.0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346 7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373.0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884.0-12.356 5.78-11.981 12.654z"/></svg>
</span>
</span>
<span class=dark:text-neutral-300><strong>Warning!</strong> This action is destructive!</span>
</div>
<h2 id=badge class="relative group">Badge <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#badge aria-label=Anchor>#</a></span></h2>
<p><code>badge</code> outputs a styled badge component which is useful for displaying metadata.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>badge</span> <span class=p>&gt;</span>}}
New article!
{{<span class=p>&lt;</span> <span class=p>/</span><span class=nt>badge</span> <span class=p>&gt;</span>}}
</code></pre></div><span class=flex>
<span class="ltr:ml-1 rtl:mr-1 px-1 py-[1px] text-xs font-normal border rounded-md text-primary-700 dark:text-primary-400 border-primary-400 dark:border-primary-600">
New article!
</span>
</span>
<h2 id=button class="relative group">Button <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#button aria-label=Anchor>#</a></span></h2>
<p><code>button</code> outputs a styled button component which can be used to highlight a primary action. It has two optional variables <code>href</code> and <code>target</code> which can be used to specify the URL and target of the link.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>button</span> <span class=na>href</span><span class=o>=</span><span class=s>&#34;#button&#34;</span> <span class=na>target</span><span class=o>=</span><span class=s>&#34;_self&#34;</span> <span class=p>&gt;</span>}}
Call to action
{{<span class=p>&lt;</span> <span class=p>/</span><span class=nt>button</span> <span class=p>&gt;</span>}}
</code></pre></div><a class="px-4 py-2 !text-neutral !no-underline !rounded-md bg-primary-600 hover:!bg-primary-500 dark:bg-primary-800 dark:hover:!bg-primary-700" href=#button target=_self role=button>
Call to action
</a>
<h2 id=chart class="relative group">Chart <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#chart aria-label=Anchor>#</a></span></h2>
<p><code>chart</code> uses the Chart.js library to embed charts into articles using simple structured data. It supports a number of <a href=https://www.chartjs.org/docs/latest/samples/>different chart styles</a> and everything can be configured from within the shortcode. Simply provide the chart parameters between the shortcode tags and Chart.js will do the rest.</p>
<p>Refer to the <a href=https://www.chartjs.org/docs/latest/general/>official Chart.js docs</a> for details on syntax and supported chart types.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-js data-lang=js><span class=p>{{</span><span class=o>&lt;</span> <span class=nx>chart</span> <span class=o>&gt;</span><span class=p>}}</span>
<span class=nx>type</span><span class=o>:</span> <span class=s1>&#39;bar&#39;</span><span class=p>,</span>
<span class=nx>data</span><span class=o>:</span> <span class=p>{</span>
<span class=nx>labels</span><span class=o>:</span> <span class=p>[</span><span class=s1>&#39;Tomato&#39;</span><span class=p>,</span> <span class=s1>&#39;Blueberry&#39;</span><span class=p>,</span> <span class=s1>&#39;Banana&#39;</span><span class=p>,</span> <span class=s1>&#39;Lime&#39;</span><span class=p>,</span> <span class=s1>&#39;Orange&#39;</span><span class=p>],</span>
<span class=nx>datasets</span><span class=o>:</span> <span class=p>[{</span>
<span class=nx>label</span><span class=o>:</span> <span class=s1>&#39;# of votes&#39;</span><span class=p>,</span>
<span class=nx>data</span><span class=o>:</span> <span class=p>[</span><span class=mi>12</span><span class=p>,</span> <span class=mi>19</span><span class=p>,</span> <span class=mi>3</span><span class=p>,</span> <span class=mi>5</span><span class=p>,</span> <span class=mi>2</span><span class=p>,</span> <span class=mi>3</span><span class=p>],</span>
<span class=p>}]</span>
<span class=p>}</span>
<span class=p>{{</span><span class=o>&lt;</span> <span class=err>/chart &gt;}}</span>
</code></pre></div>
<div class=chart>
<canvas id=862579341></canvas>
<script type=text/javascript>window.addEventListener("DOMContentLoaded",b=>{const a=document.getElementById("862579341"),c=new Chart(a,{type:'bar',data:{labels:['Tomato','Blueberry','Banana','Lime','Orange'],datasets:[{label:'# of votes',data:[12,19,3,5,3]}]}})})</script>
</div>
<p>You can see some additional Chart.js examples on the <a href=https://jpanther.github.io/congo/samples/charts/>charts samples</a> page.</p>
<h2 id=figure class="relative group">Figure <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#figure aria-label=Anchor>#</a></span></h2>
<p>Congo includes a <code>figure</code> shortcode for adding images to content. The shortcode replaces the base Hugo functionality in order to provide additional performance benefits.</p>
<p>When a provided image is a page resource, it will be optimised using Hugo Pipes and scaled in order to provide images appropriate to different device resolutions. If a URL to an external image is provided, it will be included as-is without any image processing by Hugo.</p>
<p>The <code>figure</code> shortcode accepts six parameters:</p>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>src</code></td>
<td><strong>Required.</strong> The filename or URL of the image. When providing a filename, this image must be a <a href=https://gohugo.io/content-management/page-resources/>page resource</a> bundled with the page.</td>
</tr>
<tr>
<td><code>alt</code></td>
<td><a href=https://moz.com/learn/seo/alt-text>Alternative text description</a> for the image.</td>
</tr>
<tr>
<td><code>caption</code></td>
<td>Markdown for the image caption, which will be displayed below the image.</td>
</tr>
<tr>
<td><code>class</code></td>
<td>Additional CSS classes to apply to the image.</td>
</tr>
<tr>
<td><code>href</code></td>
<td>URL that the image should be linked to.</td>
</tr>
<tr>
<td><code>default</code></td>
<td>Special parameter to revert to default Hugo <code>figure</code> behaviour. Simply provide <code>default=true</code> and then use normal <a href=https://gohugo.io/content-management/shortcodes/#figure>Hugo shortcode syntax</a>.</td>
</tr>
</tbody>
</table>
<p>Congo also supports automatic conversion of images included using standard Markdown syntax. Simply use the following format and the theme will handle the rest:</p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>![<span class=nt>Alt text</span>](<span class=na>image.jpg &#34;Image caption&#34;</span>)
</code></pre></div><p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>figure</span>
<span class=na>src</span><span class=o>=</span><span class=s>&#34;abstract.jpg&#34;</span>
<span class=na>alt</span><span class=o>=</span><span class=s>&#34;Abstract purple artwork&#34;</span>
<span class=na>caption</span><span class=o>=</span><span class=s>&#34;Photo by </span>[<span class=nt>Jr Korpa</span>](<span class=na>https://unsplash.com/@jrkorpa</span>)<span class=s> on </span>[<span class=nt>Unsplash</span>](<span class=na>https://unsplash.com/</span>)<span class=s>&#34;</span>
<span class=p>&gt;</span>}}
<span class=c>&lt;!-- OR --&gt;</span>
![<span class=nt>Abstract purple artwork</span>](<span class=na>abstract.jpg &#34;Photo by [Jr Korpa](https://unsplash.com/@jrkorpa</span>) on [<span class=nt>Unsplash</span>](<span class=na>https://unsplash.com/</span>)&#34;)
</code></pre></div>
<figure>
<img class="my-0 rounded-md" srcset="/congo/docs/shortcodes/abstract_hu684c0a32e4d0f58583128be29b348bb9_40710_330x0_resize_q75_box.jpg 330w,
/congo/docs/shortcodes/abstract_hu684c0a32e4d0f58583128be29b348bb9_40710_660x0_resize_q75_box.jpg 660w,
/congo/docs/shortcodes/abstract_hu684c0a32e4d0f58583128be29b348bb9_40710_1024x0_resize_q75_box.jpg 1024w,
/congo/docs/shortcodes/abstract_hu684c0a32e4d0f58583128be29b348bb9_40710_1320x0_resize_q75_box.jpg 2x" src=/congo/docs/shortcodes/abstract_hu684c0a32e4d0f58583128be29b348bb9_40710_660x0_resize_q75_box.jpg alt="Abstract purple artwork">
<figcaption>Photo by <a href=https://unsplash.com/@jrkorpa>Jr Korpa</a> on <a href=https://unsplash.com/>Unsplash</a></figcaption>
</figure>
<h2 id=icon class="relative group">Icon <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#icon aria-label=Anchor>#</a></span></h2>
<p><code>icon</code> outputs an SVG icon and takes the icon name as its only parameter. The icon is scaled to match the current text size.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>icon</span> <span class=err>&#34;</span><span class=na>github</span><span class=err>&#34;</span> <span class=p>&gt;</span>}}
</code></pre></div><p><strong>Output:</strong>
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github" class="svg-inline--fa fa-github fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentcolor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6.0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6.0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3.0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1.0-6.2-.3-40.4-.3-61.4.0.0-70 15-84.7-29.8.0.0-11.4-29.1-27.8-36.6.0.0-22.9-15.7 1.6-15.4.0.0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5.0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9.0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4.0 33.7-.3 75.4-.3 83.6.0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6.0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9.0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
</span>
</p>
<p>Icons are populated using Hugo pipelines which makes them very flexible. Congo includes a number of built-in icons for social, links and other purposes. Check the <a href=https://jpanther.github.io/congo/samples/icons/>icon samples</a> page for a full list of supported icons.</p>
<p>Custom icons can be added by providing your own icon assets in the <code>assets/icons/</code> directory of your project. The icon can then be referenced in the shortcode by using the SVG filename without the <code>.svg</code> extension.</p>
<p>Icons can also be used in partials by calling the <a href=https://jpanther.github.io/congo/docs/partials/#icon>icon partial</a>.</p>
<h2 id=katex class="relative group">Katex <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#katex aria-label=Anchor>#</a></span></h2>
<p>The <code>katex</code> shortcode can be used to add mathematical expressions to article content using the KaTeX package. Refer to the online reference of <a href=https://katex.org/docs/supported.html>supported TeX functions</a> for the available syntax.</p>
<p>To include mathematical expressions in an article, simply place the shortcode anywhere with the content. It only needs to be included once per article and KaTeX will automatically render any markup on that page. Both inline and block notation are supported.</p>
<p>Inline notation can be generated by wrapping the expression in <code>\\(</code> and <code>\\)</code> delimiters. Alternatively, block notation can be generated using <code>$$</code> delimiters.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>katex</span> <span class=p>&gt;</span>}}
\\(f(a,b,c) = (a^2+b^2+c^2)^3\\)
</code></pre></div><p>
\(f(a,b,c) = (a^2+b^2+c^2)^3\)</p>
<p>Check out the <a href=https://jpanther.github.io/congo/samples/mathematical-notation/>mathematical notation samples</a> page for more examples.</p>
<h2 id=lead class="relative group">Lead <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#lead aria-label=Anchor>#</a></span></h2>
<p><code>lead</code> is used to bring emphasis to the start of an article. It can be used to style an introduction, or to call out an important piece of information. Simply wrap any Markdown content in the <code>lead</code> shortcode.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>lead</span> <span class=p>&gt;</span>}}
When life gives you lemons, make lemonade.
{{<span class=p>&lt;</span> <span class=p>/</span><span class=nt>lead</span> <span class=p>&gt;</span>}}
</code></pre></div><div class="!mb-9 text-xl lead">
When life gives you lemons, make lemonade.
</div>
<h2 id=mermaid class="relative group">Mermaid <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style=text-decoration-line:none!important href=#mermaid aria-label=Anchor>#</a></span></h2>
<p><code>mermaid</code> allows you to draw detailed diagrams and visualisations using text. It uses Mermaid under the hood and supports a wide variety of diagrams, charts and other output formats.</p>
<p>Simply write your Mermaid syntax within the <code>mermaid</code> shortcode and let the plugin do the rest.</p>
<p>Refer to the <a href=https://mermaid-js.github.io/>official Mermaid docs</a> for details on syntax and supported diagram types.</p>
<p><strong>Example:</strong></p>
<div class=highlight><pre tabindex=0 class=chroma><code class=language-md data-lang=md>{{<span class=p>&lt;</span> <span class=nt>mermaid</span> <span class=p>&gt;</span>}}
graph LR;
A[Lemons]--&gt;B[Lemonade];
B--&gt;C[Profit]
{{<span class=p>&lt;</span> <span class=p>/</span><span class=nt>mermaid</span> <span class=p>&gt;</span>}}
</code></pre></div><div class=mermaid align=center>
graph LR;
A[Lemons]-->B[Lemonade];
B-->C[Profit]
</div>
<p>You can see some additional Mermaid examples on the <a href=https://jpanther.github.io/congo/samples/diagrams-flowcharts/>diagrams and flowcharts samples</a> page.</p>
</div>
</section>
<footer class="pt-8 max-w-prose">
<div class=pt-8>
<hr class="border-dotted border-neutral-300 dark:border-neutral-600">
<div class="flex justify-between pt-3">
<span>
<a class="flex group" href=/congo/docs/front-matter/>
<span class="mr-3 ltr:inline rtl:hidden text-neutral-700 dark:text-neutral group-hover:text-primary-600 dark:group-hover:text-primary-400">&larr;</span>
<span class="ml-3 ltr:hidden rtl:inline text-neutral-700 dark:text-neutral group-hover:text-primary-600 dark:group-hover:text-primary-400">&rarr;</span>
<span class="flex flex-col">
<span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500">Front Matter</span>
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
</span>
</span>
</a>
</span>
<span>
<a class="flex text-right group" href=/congo/docs/partials/>
<span class="flex flex-col">
<span class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500">Partials</span>
<span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
</span>
</span>
<span class="ml-3 ltr:inline rtl:hidden text-neutral-700 dark:text-neutral group-hover:text-primary-600 dark:group-hover:text-primary-400">&rarr;</span>
<span class="mr-3 ltr:hidden rtl:inline text-neutral-700 dark:text-neutral group-hover:text-primary-600 dark:group-hover:text-primary-400">&larr;</span>
</a>
</span>
</div>
</div>
</footer>
</article>
<div class="absolute top-[110vh] ltr:right-0 rtl:left-0 w-12 pointer-events-none bottom-[-5.5rem]">
<a href=#the-top class="w-12 h-12 sticky pointer-events-auto top-[calc(100vh-5rem)] bg-neutral/50 dark:bg-neutral-800/50 backdrop-blur rounded-full text-xl flex items-center justify-center text-neutral-700 dark:text-neutral hover:text-primary-600 dark:hover:text-primary-400" aria-label="Scroll to top" title="Scroll to top">
&uarr;
</a>
</div>
</main>
<div id=search-wrapper class="fixed inset-0 z-50 flex flex-col p-4 sm:p-6 md:p-[10vh] lg:p-[12vh] w-screen h-screen cursor-default bg-neutral-500/50 backdrop-blur-sm dark:bg-neutral-900/50 invisible" data-url=https://jpanther.github.io/congo/>
<div id=search-modal class="flex flex-col w-full max-w-3xl min-h-0 mx-auto border rounded-md shadow-lg border-neutral-200 top-20 bg-neutral dark:bg-neutral-800 dark:border-neutral-700">
<header class="relative z-10 flex items-center justify-between flex-none px-2">
<form class="flex items-center flex-auto min-w-0">
<div class="flex items-center justify-center w-8 h-8 text-neutral-400">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="search" class="svg-inline--fa fa-search fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentcolor" d="M505 442.7 405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9.0 208 0S0 93.1.0 208s93.1 208 208 208c48.3.0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9.0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7.0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7.0 128 57.2 128 128 0 70.7-57.2 128-128 128z"/></svg>
</span>
</div>
<input type=search id=search-query class="flex flex-auto h-12 mx-1 bg-transparent appearance-none focus:outline-dotted focus:outline-transparent focus:outline-2" placeholder=Search tabindex=0>
</form>
<button id=close-search-button class="flex items-center justify-center w-8 h-8 text-neutral-700 dark:text-neutral hover:text-primary-600 dark:hover:text-primary-400" title="Close (Esc)">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentcolor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19.0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48.0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48.0L9.21 111.45c-12.28 12.28-12.28 32.19.0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19.0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48.0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48.0l22.24-22.24c12.28-12.28 12.28-32.19.0-44.48L242.72 256z"/></svg>
</span>
</button>
</header>
<section class="flex-auto px-2 overflow-auto">
<ul id=search-results>
</ul>
</section>
</div>
</div>
<footer class=py-10>
<div class="flex justify-between">
<div>
<p class="text-sm text-neutral-500 dark:text-neutral-400">
© 2022 Congo contributors
</p>
<p class="text-xs text-neutral-500 dark:text-neutral-400">
Powered by <a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" href=https://gohugo.io/ target=_blank rel="noopener noreferrer">Hugo</a> & <a class="hover:underline hover:decoration-primary-400 hover:text-primary-500" href=https://git.io/hugo-congo target=_blank rel="noopener noreferrer">Congo</a>
</p>
</div>
<div class="text-sm cursor-pointer text-neutral-700 dark:text-neutral hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-14 rtl:ml-14">
<button id=appearance-switcher class="w-12 h-12" type=button title="Switch to dark appearance">
<span class="inline dark:hidden">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="moon" class="svg-inline--fa fa-moon fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentcolor" d="M283.211 512c78.962.0 151.079-35.925 198.857-94.792 7.068-8.708-.639-21.43-11.562-19.35-124.203 23.654-238.262-71.576-238.262-196.954.0-72.222 38.662-138.635 101.498-174.394 9.686-5.512 7.25-20.197-3.756-22.23A258.156 258.156.0 00283.211.0c-141.309.0-256 114.511-256 256 0 141.309 114.511 256 256 256z"/></svg>
</span>
</span>
<span class="hidden dark:inline">
<span class="relative inline-block align-text-bottom icon"><svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sun" class="svg-inline--fa fa-sun fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentcolor" d="M256 160c-52.9.0-96 43.1-96 96s43.1 96 96 96 96-43.1 96-96-43.1-96-96-96zm246.4 80.5-94.7-47.3 33.5-100.4c4.5-13.6-8.4-26.5-21.9-21.9l-100.4 33.5-47.4-94.8c-6.4-12.8-24.6-12.8-31 0l-47.3 94.7L92.7 70.8c-13.6-4.5-26.5 8.4-21.9 21.9l33.5 100.4-94.7 47.4c-12.8 6.4-12.8 24.6.0 31l94.7 47.3-33.5 100.5c-4.5 13.6 8.4 26.5 21.9 21.9l100.4-33.5 47.3 94.7c6.4 12.8 24.6 12.8 31 0l47.3-94.7 100.4 33.5c13.6 4.5 26.5-8.4 21.9-21.9l-33.5-100.4 94.7-47.3c13-6.5 13-24.7.2-31.1zm-155.9 106c-49.9 49.9-131.1 49.9-181 0s-49.9-131.1.0-181 131.1-49.9 181 0 49.9 131.1.0 181z"/></svg>
</span>
</span>
</button>
</div>
</div>
</footer>
</body>
</html>