Netlify CMS Tips & Tricks
Many IDRC project websites created since 2020 use the Eleventy static site generator in combination with Netlify CMS for content management. This page documents some useful tips and tricks for configurin, managing and using Netlify CMS.
Sites using Netlify CMS
As of April 2021, the following sites use Eleventy and Netlify CMS:
- Community-Led Co-design Kit
- Co-designing Accessibility in Action
- Inclusive Design Research Centre
- We Count
- Weavly
Basic Configuration
User Accounts and Roles
Netlify CMS uses the Netlify Identity service to authenticate users. All of the above sites are currently configured to allow all registered users to administer the site via Netlify CMS, with user registration set to invitation only. In the event that users without administrative privileges are required (e.g. for user accounts that have some other purpose, such as user preference management or providing access to some content only upon registration), role-based access to the CMS could be implemented using the redirect method described here.
Git Access
Netlify CMS uses Netlify's Git Gateway to grant authenticated users the ability to open and merge Github pull requests during the content management process without them needing to have Github accounts or use git themselves. In all instances except for the Social Justice Repair Kit website, the Git Gateway has been configured with a dedicated Github account (idrc-cms-bot
). If you need to enable the Git Gateway on a new site:
- Log in to Github as the
idrc-cms-bot
user (credentials are in 1Password). - Verify that the
idrc-cms-bot
user has write access to the site's Github repository. - In Netlify's interface, navigate to your site's Settings → Identity → Services panel, and enable the Git Gateway.
This will ensure that all Github operations for content management are carried out by the idrc-cms-bot.
If you use GitHub credentials to log into Netlify, you'll need to log into Netlify first, then go to GitHub in another browser tab and log in there as the idrc-cms-bot
. In this way when you generate the token from Netlify, it will use the bot's access token.