<!doctype html><htmllang=en-audir=ltrclass=scroll-smoothdata-default-appearance=lightdata-auto-appearance=true><head><metacharset=utf-8><metahttp-equiv=content-languagecontent="en-au"><metaname=viewportcontent="width=device-width,initial-scale=1"><metahttp-equiv=x-ua-compatiblecontent="ie=edge"><title>Partials · Congo</title><metaname=titlecontent="Partials · Congo"><metaname=descriptioncontent="A powerful, lightweight theme for Hugo built with Tailwind CSS."><linkrel=canonicalhref=https://jpanther.github.io/congo/docs/partials/><linktype=text/cssrel=stylesheethref=/congo/css/main.bundle.min.fe92cefeb86e1cd65b82d4143fbb9f1dd28e4e3cd5990d2ed6dff3db6bd5253228486521e25088b229d2457d24c5c9337e29093b8d10d3c3f9cd6174596f8042.cssintegrity="sha512-/pLO/rhuHNZbgtQUP7ufHdKOTjzVmQ0u1t/z22vVJTIoSGUh4lCIsinSRX0kxckzfikJO40Q08P5zWF0WW+AQg=="><scripttype=text/javascriptsrc=/congo/js/appearance.min.12e98742cd283574d030a7fe55f29597df4ee214f7ff7075b4d19a64d046a602753c715295550be7899b661619cec89c679049d36c624681671a8013c1249896.jsintegrity="sha512-EumHQs0oNXTQMKf+VfKVl99O4hT3/3B1tNGaZNBGpgJ1PHFSlVUL54mbZhYZzsicZ5BJ02xiRoFnGoATwSSYlg=="></script>
<spanclass=mb-[2px]><ahref=https://github.com/jpanther/congo/tree/dev/exampleSite/content/docs/partials.mdclass="text-lg hover:text-primary-500"rel="noopener noreferrer"target=_blanktitle="Edit content"><spanclass="relative inline-block align-text-bottom icon"><svgxmlns="http://www.w3.org/2000/svg"viewBox="0 0 512 512"><pathfill="currentcolor"d="M490.3 40.4c21.9 21.87 21.9 57.33.0 79.2l-30 30.1-98-97.98 30.1-30.06C414.3-.2135 449.7-.2135 471.6 21.66L490.3 40.4zM172.4 241.7 339.7 74.34l98 97.96L270.3 339.6C264.2 345.8 256.7 350.4 248.4 353.2l-88.8 29.6C150.1 385.6 141.5 383.4 135 376.1 128.6 370.5 126.4 361 129.2 352.4l29.6-88.8C161.6 255.3 166.2 247.8 172.4 241.7v0zM192 63.1c17.7.0 32 15.23 32 32 0 18.6-14.3 32-32 32H96c-17.67.0-32 15.2-32 32V416c0 17.7 14.33 32 32 32H352c17.7.0 32-14.3 32-32V319.1c0-16.8 14.3-32 32-32s32 15.2 32 32V416c0 53-43 96-96 96H96c-53.02.0-96-43-96-96V159.1c0-53 42.98-96 96-96h96z"/></svg></span></a></span></div></div></header><sectionclass="flex flex-col max-w-full mt-0 prose lg:flex-row dark:prose-invert"><divclass="order-first px-0 lg:max-w-xs ltr:lg:pl-8 rtl:lg:pr-8 lg:order-last"><divclass="ltr:pl-5 rtl:pr-5 toc lg:sticky lg:top-10 print:hidden"><detailsopenclass="mt-0 overflow-hidden rounded-lg rtl:pr-5 ltr:pl-5 ltr:-ml-5 rtl:-mr-5 lg:mt-3"><summaryclass="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><divclass="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"><navid=TableOfContents><ul><li><ahref=#analytics>Analytics</a><ul><li><ahref=#fathom-analytics>Fathom Analytics</a></li><li><ahref=#google-analytics>Google Analytics</a></li><li><ahref=#custom-analytics-providers>Custom analytics providers</a></li></ul></li><li><ahref=#comments>Comments</a></li><li><ahref=#favicons>Favicons</a></li><li><ahref=#icon>Icon</a></li><li><ahref=#extensions>Extensions</a><ul><li><ahref=#article-link>Article link</a></li><li><ahref=#head-and-footer>Head and Footer</a></li></ul></li></ul></nav></div></details></div></div><divclass="min-w-0 min-h-0 max-w-prose"><h2id=analyticsclass="relative group">Analytics <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#analyticsaria-label=Anchor>#</a></span></h2><p>Congo provides built-in support for Fathom Analytics and Google Analytics. Fathom is a paid alternative to Google Analytics that respects user privacy. If you’re interested you can use this affiliate link to <ahref=https://usefathom.com/ref/RLAJSV>receive $10 credit</a> and try the service.</p><h3id=fathom-analyticsclass="relative group">Fathom Analytics <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#fathom-analyticsaria-label=Anchor>#</a></span></h3><p>To enable Fathom Analytics support, simply provide your Fathom site code in the <code>config/_default/params.toml</code> file. If you also use the custom domain feature of Fathom and would like to serve their script from your domain, you can also additionally provide the <code>domain</code> configuration value. If you don’t provide a <code>domain</code> value, the script will load directly from Fathom DNS.</p><divclass=highlight><pretabindex=0class=chroma><codeclass=language-tomldata-lang=toml><spanclass=line><spanclass=cl><spanclass=c># config/_default/params.toml</span>
</span></span></code></pre></div><h3id=google-analyticsclass="relative group">Google Analytics <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#google-analyticsaria-label=Anchor>#</a></span></h3><p>Google Analytics support is provided through the internal Hugo partial. Simply provide the <code>googleAnalytics</code> key in the <code>config/_default/config.toml</code> file and the script will be added automatically.</p><p>Both version 3 (analytics.js) and version 4 (gtag.js) are supported, based on the configuration value provided:</p><divclass=highlight><pretabindex=0class=chroma><codeclass=language-tomldata-lang=toml><spanclass=line><spanclass=cl><spanclass=c># config/_default/config.toml</span>
</span></span><spanclass=line><spanclass=cl>
</span></span><spanclass=line><spanclass=cl><spanclass=c># version 3</span>
</span></span></code></pre></div><h3id=custom-analytics-providersclass="relative group">Custom analytics providers <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#custom-analytics-providersaria-label=Anchor>#</a></span></h3><p>If you wish to use a different analytics provider on your website you can also override the analytics partial and provide your own script. Simply create the file <code>layouts/partials/analytics.html</code> in your project and it will automatically include it in the <code><head></code> of the website.</p><h2id=commentsclass="relative group">Comments <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#commentsaria-label=Anchor>#</a></span></h2><p>To add comments to your articles, Congo includes support for a comments partial that is included at the base of each article page. Simply provide a <code>layouts/partials/comments.html</code> which contains the code required to display your chosen comments.</p><p>You can use either the built-in Hugo Disqus template, or provide your own custom code. Refer to the <ahref=https://gohugo.io/content-management/comments/>Hugo docs</a> for further information.</p><h2id=faviconsclass="relative group">Favicons <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#faviconsaria-label=Anchor>#</a></span></h2><p>Congo provides a default set of blank favicons to get started but you can provide your own assets to override them. The easiest way to obtain new favicon assets is to generate them using a third-party provider like <ahref=https://favicon.io>favicon.io</a>.</p><p>Icon assets should be placed directly in the <code>static/</code> folder of your website and named as per the listing below. If you use <ahref=https://favicon.io>favicon.io</a>, these will be the filenames that are automatically generated for you, but you can provide your own assets if you wish.</p><divclass=highlight><pretabindex=0class=chroma><codeclass=language-shelldata-lang=shell><spanclass=line><spanclass=cl>static/
</span></span></code></pre></div><p>Alternatively, you can also completely override the default favicon behaviour and provide your own favicon HTML tags and assets. Simply provide a <code>layouts/partials/favicons.html</code> file in your project and this will be injected into the site <code><head></code> in place of the default assets.</p><h2id=iconclass="relative group">Icon <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#iconaria-label=Anchor>#</a></span></h2><p>Similar to the <ahref=https://jpanther.github.io/congo/docs/shortcodes/#icon>icon shortcode</a>, you can include icons in your own templates and partials by using Congo’s <code>icon.html</code> partial. The partial takes one parameter which is the name of the icon to be included.</p><p><strong>Example:</strong></p><divclass=highlight><pretabindex=0class=chroma><codeclass=language-godata-lang=go><spanclass=line><spanclass=cl><spanclass=p>{{</span><spanclass=nx>partial</span><spanclass=s>"icon.html"</span><spanclass=s>"github"</span><spanclass=p>}}</span>
</span></span></code></pre></div><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 <ahref=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 partial by using the SVG filename without the <code>.svg</code> extension.</p><p>Icons can also be used in article content by calling the <ahref=https://jpanther.github.io/congo/docs/shortcodes/#icon>icon shortcode</a>.</p><h2id=extensionsclass="relative group">Extensions <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#extensionsaria-label=Anchor>#</a></span></h2><p>Congo also provides for a number of extension partials that allow for expanding upon base functionality.</p><h3id=article-linkclass="relative group">Article link <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#article-linkaria-label=Anchor>#</a></span></h3><p>If you wish to insert additional code after article links, create a <code>layouts/partials/extend-article-link.html</code> file. This is especially powerful when combined with the <ahref=https://jpanther.github.io/congo/docs/shortcodes/#badge><code>badge</code></a> shortcode which can be used to highlight metadata for certain articles.</p><h3id=head-and-footerclass="relative group">Head and Footer <spanclass="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"><aclass="group-hover:text-primary-300 dark:group-hover:text-neutral-700"style=text-decoration-line:none!importanthref=#head-and-footeraria-label=Anchor>#</a></span></h3><p>The theme allows for inserting additional code directly into the <code><head></code> and <code><footer></code> sections of the template. These can be useful for providing scripts or other logic that isn’t part of the theme.</p><p>Simply create either <code>layouts/partials/extend-head.html</code> or <code>layouts/partials/extend-footer.html</code> and these will automatically be included in your website build. Both partials are injected as the last items in <code><head></code> and <code><footer></code> so they can be used to override theme defaults.</p></div></section><footerclass="pt-8 max-w-prose print:hidden"><divclass=pt-8><hrclass="border-dotted border-neutral-300 dark:border-neutral-600"><divclass="flex justify-between pt-3"><span><aclass="flex group"href=/congo/docs/shortcodes/><spanclass="mr-3 ltr:inline rtl:hidden text-neutral-700 dark:text-neutral group-hover:text-primary-600 dark:group-hover:text-primary-400">←</span>