Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
React.useEffect(() => {
if (process.env.NODE_ENV === 'development') {
// const FileSystemBackend = import('netlify-cms-backend-fs');
// console.log('FileSystemBackend', FileSystemBackend)
config.backend = {
"name": "file-system",
"api_root": "http://localhost:3000/api"
}
CMS.registerBackend('file-system', FileSystemBackend);
}
CMS.registerPreviewTemplate('authors', AuthorsPreview);
CMS.registerEditorComponent(EditorYoutube);
CMS.init({ config });
})
import CMS from "netlify-cms-app"
import { HomePagePreview, DefaultPagePreview } from "./preview-templates"
import { ctaEditorConfig } from "./editor-components"
// Not reliably loaded by registerPreviewStyle, so import directly
import "../app.css"
// Add Previews
CMS.registerPreviewTemplate("home", HomePagePreview)
CMS.registerPreviewTemplate("content", DefaultPagePreview)
// Extend editor
CMS.registerEditorComponent(ctaEditorConfig)
React.useEffect(() => {
console.log(`CMS [${process.env.NODE_ENV}]`, CMS, )
if (process.env.NODE_ENV === 'development') {
config.load_config_file = false
config.backend = {
"name": "file-system",
"api_root": "http://localhost:3000/api"
}
CMS.registerBackend('file-system', FileSystemBackend);
}
CMS.registerPreviewTemplate("posts", PostPreview);
CMS.registerPreviewStyle(previewStyles, { raw: true });
CMS.registerPreviewTemplate("authors", AuthorsPreview);
CMS.registerPreviewTemplate("general", GeneralPreview);
CMS.registerEditorComponent(EditorYoutube);
CMS.registerWidget("relationKitchenSinkPost", "relation", RelationKitchenSinkPostPreview);
CMS.init({config})
})