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

PropertyTypeRequiredDescription
linkstringYesURL path for the home link (typically '/')
logo.srcstringYesLogo image source path
logo.altstringYesAlt 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 ) }}