Add a link to your site logo (Publish)

A user on Discord pointed out that a site logo will typically take you to the site homepage when clocked.

As the Obsidian Publish site logo doesn’t currently do this, the following code can be added to publish.js to achieve this (be sure to replace my site URL with your own!)

// element that will be wrapped - Obsidian Publish logo
var obsidianLogo = document.querySelector('.site-body-left-column-site-logo');

// create wrapper container - a with link
var wrapper = document.createElement('a');
wrapper.href = 'https://ruairimcnicholas.com/'

// insert wrapper before el in the DOM tree
obsidianLogo.parentNode.insertBefore(wrapper, obsidianLogo);

// move el into wrapper
wrapper.appendChild(obsidianLogo);
1 Like