Can I change the URL of the main logo?

This takes a little more customization because it’s prevented in the home-logo widget here:

So you’d have to use changeWidgetSetting to set the URL, and then reopenWidget to add _blank and override the default click behavior that prevents it from opening in a new window.

<script type="text/discourse-plugin" version="0.8">
  const { h } = require("virtual-dom");

  api.changeWidgetSetting('home-logo', 'href', 'https://discourse.org');

  api.reopenWidget("home-logo", {
     html() {
       return h(
         "a",
         { attributes: { href: this.href(), "data-auto-route": true, "target": "_blank" } },
         this.logo()
       );
     },

     click(e) {
       return;
     },
   });
</script>
4 Likes