Log netlifySiteUrl when viewing CMS on localhost

This commit is contained in:
Eric Jinks 2018-05-17 09:22:16 +10:00
parent 3ee082c169
commit aa9c5b913a
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
## 0.2.1 - 2018-05-17
* Log netlifySiteUrl when viewing CMS on localhost
## 0.2.0 - 2018-05-17
* Add CHANGELOG

View file

@ -33,6 +33,18 @@ CMS.registerPreviewTemplate('posts', ({ entry }) => (
<SinglePost singlePost={entry.toJS().data} />
))
// Return to home when user logging out
window.netlifyIdentity.on('logout', function () {
document.location.href = '/'
})
// Log netlifySiteURL if editing on localhost
if (
window.location.hostname === 'localhost' &&
window.localStorage.getItem('netlifySiteURL')
) {
console.log(
`%cnetlifySiteURL: ${window.localStorage.getItem('netlifySiteURL')}`,
'color: hotpink; font-size: 15px'
)
}