Skip to content

Commit b4fc3aa

Browse files
committed
Readme updated
1 parent a331065 commit b4fc3aa

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "netlify-cms-widget-permalink",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Permalink widget for Netlify CMS",
55
"main": "./dist/index.js",
66
"files": [

readme.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ This widget allows you to create custom permalinks that can be used to generate
1414

1515
```
1616
npm install netlify-cms-widget-permalink
17+
yarn add netlify-cms-widget-permalink
1718
```
1819

1920
2. Import the Permalink widget to your Netlify CMS setup file
2021

2122
```
22-
import {PermalinkControl, PermalinkPreview} from 'netlify-cms-widget-permalink';
23+
import { Widget as PermalinkWidget } from 'netlify-cms-widget-permalink';
2324
```
2425

2526
3. Register the widget for use
2627

2728
```
28-
CMS.registerWidget('permalink', PermalinkControl, PermalinkPreview)
29+
CMS.registerWidget(PermalinkWidget);
2930
```
3031

3132
## Usage details
@@ -40,7 +41,11 @@ collections:
4041
create: true
4142
slug: "{{slug}}"
4243
fields:
43-
- {label: "ID", name: "id", widget: "permalink", prefix: 'blog', url: 'http://example.com'}
44+
- label: "Permalink",
45+
name: "permalink",
46+
widget: "permalink",
47+
prefix: 'blog', // This allows to add a prefix to the correct url
48+
url: 'http://example.com'
4449
```
4550

4651
You can also use it as a JS object using Netlify CMS [Manual Initialization](https://www.netlifycms.org/docs/beta-features/#manual-initialization)
@@ -53,6 +58,7 @@ Example:
5358
name: 'permalink',
5459
widget: 'permalink',
5560
required: true,
61+
prefix: 'blog', // This allows to add a prefix to the correct url
5662
url: 'http://localhost:8000',
5763
hint: 'The post URL (do not include folder or file extension)',
5864
},

0 commit comments

Comments
 (0)