Skip to content

Commit

Permalink
updated decap cms
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Oct 25, 2023
1 parent 76daa85 commit 423b20d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
## `netlify_cms` Plugin

- Renamed to `decap_cms`.
- Changed `netlifyIdentity` option to `identity: "netlify"`

## `windi_css` Plugin

Expand Down
13 changes: 6 additions & 7 deletions plugins/decap_cms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export interface Options {
/** Data key of the configuration */
configKey: string;

/** Whether use Netlify Identity */
netlifyIdentity: boolean;
/** Whether use a identity method */
identity?: "netlify";

/** Custom HTML code to append in the index.html page */
extraHTML: string;
Expand All @@ -32,13 +32,12 @@ export const defaults: Options = {
local: undefined,
path: "/admin/",
configKey: "decap_cms",
netlifyIdentity: false,
extraHTML: "",
proxyCommand:
"deno run --allow-read --allow-net=0.0.0.0 --allow-write --allow-env npm:netlify-cms-proxy-server",
"deno run --allow-read --allow-net=0.0.0.0 --allow-write --allow-env npm:decap-server",
};

/** A plugin to use Netlify CMS in Lume easily */
/** A plugin to use Decap CMS in Lume easily */
export default function (userOptions?: Partial<Options>) {
const options = merge(defaults, userOptions);

Expand Down Expand Up @@ -86,10 +85,10 @@ export default function (userOptions?: Partial<Options>) {
}" type="text/yaml" rel="cms-config-url">`,
);
code.push(
`<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>`,
`<script src="https://unpkg.com/decap-cms@3.0.12/dist/decap-cms.js"></script>`,
);

if (options.netlifyIdentity) {
if (options.identity === "netlify") {
code.push(
`<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>`,
);
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/decap_cms.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ local_backend: false
<title>Admin</title>
</head>
<body>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/decap-cms@3.0.12/dist/decap-cms.js"></script>
</body>
</html>
',
Expand All @@ -159,7 +159,7 @@ local_backend: false
<title>Admin</title>
</head>
<body>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url"><script src="https://unpkg.com/decap-cms@3.0.12/dist/decap-cms.js"></script>
</body>
</html>
',
Expand Down

0 comments on commit 423b20d

Please sign in to comment.