项目作者: karolis-sh

项目描述 :
Pathname input widget for Netlify CMS
高级语言: JavaScript
项目地址: git://github.com/karolis-sh/netlify-cms-widget-pathname.git
创建时间: 2018-12-01T13:13:10Z
项目社区:https://github.com/karolis-sh/netlify-cms-widget-pathname

开源协议:MIT License

下载


netlify-cms-widget-pathname

npm version
Node.js CI
License: MIT
code style: prettier

This widget provides pathname validation and URL preview. This might be handy if
you construct URL’s based on input field. Check out the demo!

preview

Install

  1. npm i netlify-cms-widget-pathname

or

  1. yarn add netlify-cms-widget-pathname

Setup

  1. import { PathnameControl, PathnamePreview } from 'netlify-cms-widget-pathname';
  2. CMS.registerWidget('pathname', PathnameControl, PathnamePreview);

How to use

Add to your Netlify CMS configuration:

  1. fields:
  2. - name: pathname
  3. label: Page pathname
  4. widget: pathname

Configuration

You can customize the preview of the URL with these options:

  • url_prefix - add a prefix for the pathname
  1. fields:
  2. - name: pathname
  3. label: Page pathname
  4. widget: pathname
  5. url_prefix: /blog
  • url_origin - customize the URL’s origin (default is window.location.origin)
  1. fields:
  2. - name: pathname
  3. label: Page pathname
  4. widget: pathname
  5. url_origin: https://github.com