Partial Component
Branding
The Branding partial provides a simple, consistent way to display your site logo as a clickable link back to the homepage.
Manifest
{
"name": "branding",
"type": "_partials",
"styles": ["branding.css"],
"scripts": [],
"requires": []
}
Configuration
branding:
link: '/'
logo:
src: '/assets/images/logo.svg'
alt: 'Metalsmith Components'
Configuration Options
Property | Type | Required | Description |
---|---|---|---|
link | string | Yes | URL path for the home link (typically '/') |
logo.src | string | Yes | Logo image source path |
logo.alt | string | Yes | Alt text for the logo image |
Example
The branding element can be seen in the upper left corner of this page
Usage in Templates
{% from "components/_partials/branding/branding.njk" import branding %}
{% set link = '/' %}
{% set img = { src: '/assets/images/metalsmith2025-logo-bug.png', alt: 'Metalsmith Starter' } %}
{{ branding( link, img ) }}