Prerelease
This documentation covers hugolify-admin v2, which runs with hugolify-theme v2. It stays in prerelease until Sveltia CMS reaches release 1.0 and Pages CMS reaches release 3.0: report anything you hit on the issue tracker .
Still on v1? Its documentation lives on the v1 site .
What it does
A Git-based headless CMS reads a configuration file describing every collection and every field it edits. Hugolify Admin writes that file for you, at build time, from the modules your project imports:
- each section and taxonomy module brings its collection,
- each enabled block brings its form,
- each enabled shortcode joins the markdown editor.
The same project runs any supported CMS: switching from one to another means changing one param.
How it works
The module adds an /admin/ page to the site, which loads the CMS, and writes its configuration to /admin/config.yml with the rest of the build. The configuration therefore always matches the modules and the params of the site it ships with.
Pages CMS, CloudCannon and TinaCMS read their configuration from the repository instead: a script copies the generated file there, see their pages under CMS.
Under the hood, collections, blocks and fields are Hugo partials. A field calls a widget, one per field type, and the widget writes the syntax of the CMS in use.
Customize it
Most changes happen in /config/_default/params.yaml, under admin:
| To change | See |
|---|---|
| The CMS, the Git backend, the media folders, the languages | Setup |
| Which collections show, in which order, with which options | Collections |
| Which blocks an editor can add, and their fields | Blocks |
| The fields of an object, the options of a select, the markdown editor | Fields |
| Which shortcodes the markdown editor offers | Shortcodes |
When params are not enough, override a partial of the module, or add your own, in /layouts/_partials/admin/: a block, a field, a collection, a shortcode.
Supported CMS
| CMS | Status | Configuration |
|---|---|---|
| Sveltia CMS | Preferred | /admin/config.yml, generated |
| Decap CMS | Maintained | /admin/config.yml, generated |
| Pages CMS | Maintained | .pages.yml, copied by a script |
| CloudCannon | Beta | cloudcannon.config.yml, copied by a script |
| TinaCMS | Beta | tina/config.js, copied from the build |
| Netlify CMS | Archived | /admin/config.yml, generated |
| Static CMS | Archived | /admin/config.yml, generated |
Coming from v1
v2 groups the appearance of a block under a ui object, moves the menus to a collection of their own, and gives every collection option one name for every CMS. Front matter written by v2 is read by hugolify-theme v2 only.