Log netlifySiteUrl when viewing CMS on localhost
This commit is contained in:
parent
3ee082c169
commit
aa9c5b913a
2 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
12
cms/cms.js
12
cms/cms.js
|
|
@ -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'
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue