<scripttype=application/ld+json>{"@context":"https://schema.org","@type":"BlogPosting","articleSection":"Documentation","name":"Partials","headline":"Partials","description":"All the partials available in Congo.","inLanguage":"en-AU","author":{"@type":"Person","name":"Congo"},"creator":{"@type":"Person","name":"Congo"},"copyrightHolder":"Congo","copyrightYear":"2020","dateCreated":"2020-08-10T00:00:00\u002b00:00","datePublished":"2020-08-10T00:00:00\u002b00:00","dateModified":"2020-08-10T00:00:00\u002b00:00","url":"https:\/\/jpanther.github.io\/congo\/docs\/partials\/","wordCount":"656","keywords":["partials","analytics","privacy","comments","favicons","icon","docs"]}</script>
<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>
<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>
<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>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>
<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>
<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>
</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>
<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>
</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>
<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-footer>Head and Footer <aclass=heading-anchorhref=#head-and-footeraria-label=Anchor>#</a></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>