Skip to content

Instantly share code, notes, and snippets.

@danieljwonder
Created July 27, 2018 05:25
Show Gist options
  • Select an option

  • Save danieljwonder/738dce8ed01e20dccac37043735d2ded to your computer and use it in GitHub Desktop.

Select an option

Save danieljwonder/738dce8ed01e20dccac37043735d2ded to your computer and use it in GitHub Desktop.
Add Homepage Icon to Discourse Menu
<!--
To add this JavaScript code to your site theme:
1. Go to Admin > Customize > Themes
2. Select the theme you wish to customize
5. Click `Edit CSS/HTML`
4. Go to `</head>` tab
5. Copy & paste code from below
6. Click to Preview/Save
</head>
-->
<script type="text/discourse-plugin" version="0.4">
api.decorateWidget('header-icons:before', helper => {
return helper.h('li', [
helper.h('a#home-button.icon', {
href:'https://www.domain.com/',
title: '← Return to Homepage'
}, helper.h('i.fa.fa-home.home-button-icon.d-icon')),
]);
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment