3

I'm making a website based on Gatsby and I'm currently trying to add a custom component in the NetlifyCMS. It's the fontawesome widget, but I tried to add it thank to the netlifycms documentation, but it still doesn't work.

I did that :

(in static/admin/cms.js)

import * as FontawesomeWidget from "netlify-cms-widget-fontawesome";

CMS.registerWidget(
  "fontawesome",
  FontawesomeWidget.Solid,
  FontawesomeWidget.Preview
);

(in static/admin/index.html)

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
  <script src="./cms.js"></script>
  <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</body>
</html>

I should have my component working in the CMS, but I have this error :

No control for widget 'fontawesome'.

Do you have any idea how to fix that ?

  • Using this widget with a script import would require you to import it from the npm path, but has too many dependencies to be used that way and not sure they support umd modules. You can see the github project for the widget to see how they are using it inside the cms and using a bundle tool like webpack. – talves May 11 '19 at 00:18

0 Answers0