Auto PoppyGo CMS configuration

PoppyGo reads your Hugo content structure and makes it content manageable. When you change your content structure, simply run ‘generate PoppyGo config’ in the experimental menu and the changes will be visible in PoppyGo.

Hugo content stucture conventions that PoppyGo follows.

PoppyGo looks in the following folders and files:

Content folder and all of its subfolders and files

PoppyGo looks in the entire structure of the content folder. The Hugo multi-language conventions will be used by PoppyGo, for example with top-level language-code directories. Also it will read the home directory as a separate widget page, which is for example used with the Hugo Academic Theme.

All widgets in the home directory are shown.

└── content
    └── en
          └── home
                 └── banner 
                 └── highlights
                 └── gallery
          └── portfolio
          └── blog
    └── nl
          └── ..
          └── ..

PoppyGo will see whether it is a single page or a collection of pages that all have the same data structure. In case of the latter, it will take the data stucture of the second file it finds and use that as the to-go data structure for the others.

All frontmatter items are read and made content maneable depending on the type of data that is in the frontmatter.

Pagebundles with image files or other documents.

PoppyGo will look into the directory of a page to see whether there is a page resource available for the page. PoppyGo will create an “add-file” button for every subdirectory with resources in the pagebundle, so you can categorize images even at page-level.
If there is no page resource available, PoppyGo will create an “Add file” - button that stores the image in the root.

Data folder and all of its subfolders and files

All data folders are inventorised for yml, toml, and json. The Hugo multi-language conventions work here as well. So if the data is organised in languagecode directories, PoppyGo will read them as localised versions of the data files

An example:

└── data
    └── en
          └── products
          └── shipping-methods
          └── payment-methods
          └── services
    └── nl
          └── products
          └── shipping-methods
          └── payment-methods
          └── services

Configuration file config.toml (or .yml or .json) in the root

If the configuration is done in a single file in the root. PoppyGo reads this file and splits title, params and menus. In PoppyGo this will be added as Settings and Menus in the “General Menu”.

  • Title as string
  • Params as any kind
  • Menus as accordion and menu items as accordion items

Configuration in the config/_default/ directory

In some projects the configuration folder option of Hugo is used. Also this case will be read by PoppyGo. PoppyGo looks at the following files for retrieving the Title, Params and Menus.

Hugo’s multi-lingual conventions are being read here as well.

  • Config.toml (or .yml or .json) —> Title
  • Menus.toml (or .yml or .json) —> All menus and menu items.
  • Params.toml (or .yml or .json) —> All Parameters

Images in the static folder

Next to the option of images in pagebundles, Hugo works with images in the static folder. This is for example beneficial for images that are being used in many pages, like the logo to name one.

PoppyGo looks for images in the static folder itself and shows these images in the general images item. Also PoppyGo looks for an image or img folder and treats its subfolders as "grouped images". These groups are manable in PoppyGo.
Auto PoppyGo CMS configuration documentation

Data types that PoppyGo understands

As said, PoppyGo reads markdown with frontmatter, yml, json and toml. It interprets the different data types in different ways. Here we explain how the data is put into content manaeable data fields.

  • Strings shorter than 40 characters are converted into a single-line string.
  • Strings longer than 40 characters are converted into a multi-line markdown field.
  • Markdown text is converted into a multi-line markdown field.
  • Boolean (true/false) will make a switch.
  • Int or float numbers will be converted to a number field
  • Date and time types are being converted into a date/time field with data selection.
  • Arrays and slices that have a dictionary inside are converted to a accordion.
  • Arrays that have a single string field are converted into chips
  • Dictionaries are converted into sections inside the PoppyGo page.
  • Hugo’s hidden Params are also marked as hidden in PoppyGo. These are publishdat, lastmod, iscjklanguage and resources.
  • If the key is named “key”, it will convert it to a read-only field.

Also select fields are possible with PoppyGo.

Read about select fields