How to use netlify-cms - 10 common examples

To help you get started, we’ve selected a few netlify-cms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github danielmahon / gatsby-starter-procyon / src / cms / cms.js View on Github external
});
      });
      CMS.registerPreviewStyle(sheets.toString(), { raw: true });
    }
    render() {
      // Wraps the input component in a container, without mutating it. Good!
      return <template>;
    }
  }
  return withRoot(StyledTemplate);
}

CMS.registerPreviewStyle(globalStyles);
CMS.registerPreviewTemplate('home', withPreviewStyles(HomePagePreview));
CMS.registerPreviewTemplate('about', withPreviewStyles(AboutPagePreview));
CMS.registerPreviewTemplate('blog', withPreviewStyles(BlogPostPreview));
</template>
github ekoeryanto / netlify-cms-widgets / demo / widgets / app.js View on Github external
import CMS from 'netlify-cms';
import NetlifyCMSWidgetColor from 'netlify-cms-widget-color';
import NetlifyCMSWidgetFontawesome from 'netlify-cms-widget-fontawesome';
import NetlifyCMSWidgetMaterialIcons from 'netlify-cms-widget-material-icons';
import NetlifyCMSWidgetNativeColor from 'netlify-cms-widget-native-color';

CMS.registerWidget('color', NetlifyCMSWidgetColor.Control);

CMS.registerWidget(
  'fontawesome-solid',
  NetlifyCMSWidgetFontawesome.Solid,
  NetlifyCMSWidgetFontawesome.Preview,
);
CMS.registerWidget(
  'fontawesome-regular',
  NetlifyCMSWidgetFontawesome.Regular,
  NetlifyCMSWidgetFontawesome.Preview,
);
CMS.registerWidget(
  'fontawesome-brands',
  NetlifyCMSWidgetFontawesome.Brands,
  NetlifyCMSWidgetFontawesome.Preview,
);

// CMS.registerPreviewStyle('https://fonts.googleapis.com/css?family=Material+Icons');
github ekoeryanto / netlify-cms-widgets / demo / widgets / app.js View on Github external
NetlifyCMSWidgetFontawesome.Solid,
  NetlifyCMSWidgetFontawesome.Preview,
);
CMS.registerWidget(
  'fontawesome-regular',
  NetlifyCMSWidgetFontawesome.Regular,
  NetlifyCMSWidgetFontawesome.Preview,
);
CMS.registerWidget(
  'fontawesome-brands',
  NetlifyCMSWidgetFontawesome.Brands,
  NetlifyCMSWidgetFontawesome.Preview,
);

// CMS.registerPreviewStyle('https://fonts.googleapis.com/css?family=Material+Icons');
CMS.registerWidget(
  'material-icons',
  NetlifyCMSWidgetMaterialIcons.Control,
  NetlifyCMSWidgetMaterialIcons.Preview,
);

CMS.registerWidget('native-color', NetlifyCMSWidgetNativeColor.Control);
github ekoeryanto / netlify-cms-widgets / demo / widgets / app.js View on Github external
NetlifyCMSWidgetFontawesome.Preview,
);
CMS.registerWidget(
  'fontawesome-brands',
  NetlifyCMSWidgetFontawesome.Brands,
  NetlifyCMSWidgetFontawesome.Preview,
);

// CMS.registerPreviewStyle('https://fonts.googleapis.com/css?family=Material+Icons');
CMS.registerWidget(
  'material-icons',
  NetlifyCMSWidgetMaterialIcons.Control,
  NetlifyCMSWidgetMaterialIcons.Preview,
);

CMS.registerWidget('native-color', NetlifyCMSWidgetNativeColor.Control);
github uploadcare / uploadcare-netlifycms / src / index.js View on Github external
function registerPlugin(options) {
  Widget.register()

  /* eslint-disable*/
  // hack to remove default image widget
  const comps = CMS.getEditorComponents()
  comps._root.entries = []
  comps.size = 0
  /* eslint-enable*/

  CMS.registerEditorComponent(createSingle(options))
  CMS.registerEditorComponent(createMultiple(options))
}
github uploadcare / uploadcare-netlifycms / src / index.js View on Github external
function registerPlugin(options) {
  Widget.register()

  /* eslint-disable*/
  // hack to remove default image widget
  const comps = CMS.getEditorComponents()
  comps._root.entries = []
  comps.size = 0
  /* eslint-enable*/

  CMS.registerEditorComponent(createSingle(options))
  CMS.registerEditorComponent(createMultiple(options))
}
github danielmahon / gatsby-starter-procyon / src / cms / cms.js View on Github external
manager.forEach(reg =&gt; {
        reg.forEach(val =&gt; {
          sheets += val.sheet.toString();
        });
      });
      CMS.registerPreviewStyle(sheets.toString(), { raw: true });
    }
    render() {
      // Wraps the input component in a container, without mutating it. Good!
      return <template>;
    }
  }
  return withRoot(StyledTemplate);
}

CMS.registerPreviewStyle(globalStyles);
CMS.registerPreviewTemplate('home', withPreviewStyles(HomePagePreview));
CMS.registerPreviewTemplate('about', withPreviewStyles(AboutPagePreview));
CMS.registerPreviewTemplate('blog', withPreviewStyles(BlogPostPreview));
</template>
github uploadcare / uploadcare-netlifycms / src / index.js View on Github external
function registerPlugin(options) {
  Widget.register()

  /* eslint-disable*/
  // hack to remove default image widget
  const comps = CMS.getEditorComponents()
  comps._root.entries = []
  comps.size = 0
  /* eslint-enable*/

  CMS.registerEditorComponent(createSingle(options))
  CMS.registerEditorComponent(createMultiple(options))
}
github damassi / gatsby-starter-typescript-rebass-netlifycms / src / cms / cms.jsx View on Github external
import { FileSystemBackend } from "netlify-cms-backend-fs"
import CMS, { init } from "netlify-cms"

const isClient = typeof window !== "undefined"
const isDevelopment = process.env.NODE_ENV === "development"

if (isClient) {
  window.CMS_MANUAL_INIT = true
}

if (isDevelopment) {
  // Allows for local development overrides in cms.yaml
  window.CMS_ENV = "localhost_development"

  // Attach to the file system
  CMS.registerBackend("file-system", FileSystemBackend)
}

// @ts-check

// Custom components need refs for validation and thus must be a class.
// Additionally, after , only one child is allowed.
// See https://github.com/netlify/netlify-cms/issues/1346

class MDXWidget extends Component {
  render() {
    return (
      
        
      
    )
  }
github talves / netlify-cms-react-example / src / components / NetlifyCMS / index.js View on Github external
componentDidMount () {
    console.log(`CMS [${process.env.NODE_ENV}]`, CMS, )
    if (process.env.NODE_ENV === 'development') {
      config.backend = {
        "name": "file-system",
        "api_root": "http://localhost:3000/api"
      }
      CMS.registerBackend('file-system', FileSystemBackend);
    }
    CMS.init({config});
    CMS.registerPreviewTemplate('authors', AuthorsPreview);
    CMS.registerEditorComponent(EditorYoutube);
  }
  render() {