-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(netlify-cms): update for v2, add standalone build system (#6356)
* chore(netlify-cms): update for v2, add standalone build system * Restore yarn.lock * Format * Update yarn.lock * Add react/react-dom as devDependencies
- Loading branch information
1 parent
5669439
commit ddc9b80
Showing
9 changed files
with
448 additions
and
888 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import netlifyIdentityWidget from "netlify-identity-widget" | ||
|
||
window.netlifyIdentity = netlifyIdentityWidget | ||
netlifyIdentityWidget.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
/* eslint-disable no-unused-vars */ | ||
/* eslint-env browser */ | ||
import CMS from "netlify-cms" | ||
import "netlify-cms/dist/cms.css" | ||
import netlifyIdentityWidget from "netlify-identity-widget" | ||
|
||
window.netlifyIdentity = netlifyIdentityWidget | ||
netlifyIdentityWidget.init() | ||
// eslint-disable-next-line no-undef | ||
if (NETLIFY_CMS_PREVIEW_STYLES_SET) { | ||
CMS.registerPreviewStyle(`styles.css`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import netlifyIdentityWidget from "netlify-identity-widget" | ||
|
||
exports.onInitialClientRender = () => { | ||
netlifyIdentityWidget.on(`init`, user => { | ||
if (!user) { | ||
netlifyIdentityWidget.on(`login`, () => { | ||
document.location.href = `/admin/` | ||
}) | ||
} | ||
}) | ||
netlifyIdentityWidget.init() | ||
exports.onInitialClientRender = (_, { enableIdentityWidget }) => { | ||
if (enableIdentityWidget) { | ||
netlifyIdentityWidget.on(`init`, user => { | ||
if (!user) { | ||
netlifyIdentityWidget.on(`login`, () => { | ||
document.location.reload() | ||
}) | ||
} | ||
}) | ||
netlifyIdentityWidget.init() | ||
} | ||
} |
Oops, something went wrong.