Shortcodes

Add/modify shortcodes

Available for CloudCannon, Decap CMS, Netlify CMS and Sveltia CMS

Add or remove shortcodes

/config/_default/params.yaml

All shortcodes are available by default but if you want hide or add your shortcodes, you can do it:

params:
  admin:
    shortcodes:
      # Array of available shortcodes
      enable:
        - alert
        - alert-block
        - badge
        - blank_link
        - blockquote
        - button
        - dailymotion
        - details
        - figure
        - icon
        - map
        - qr
        - span_lang
        - twitch
        - twitter
        - video
        - vimeo
        - youtube

New in v2

The default list grew with alert-block, dailymotion, figure, icon, qr, span_lang, twitch, video and vimeo.

The icon shortcode joins the markdown editor for CloudCannon, Decap, Netlify and Sveltia CMS.

Disable shortcodes

/config/_default/params.yaml

params:
  admin:
    shortcodes:
      enable: false

Personalize fields

New in v2

A shortcode’s fields are overridable the way a block’s are:

/config/_default/params.yaml

params:
  admin:
    shortcodes:
      button:
        fields:
          - text
          - url
          # …

Create a shortcodes

Create file

Add a js shortcode file in shortcodes directory.

layouts/
└── partials/
    └── admin/
        └── cms/
            └── decapcms/
                └── shortcodes/

And add it in enable shortcodes: see above

Examples

See examples in repository (for decap CMS)

List of Hugolify shortcodes

Hugolify shortcodes