single

Root property: singles #

The singles property is optional. When defined Singles containes an array of dictionaries. Every dictionary defines a single form to edit a single file. The file can be located anywhere in the site directory structure but typically points to a file in the root directory, the content directory or the data directory of a hugo project.

These are the properties of a Single dictionary.

propertyvalue typeoptionaldescription
keystringmandatoryKeys are for internal use and must be unique
dataformatstring: yaml, toml,jsonmandatoryDefines the type of output format. If file is a markdown file the outputs regards to the frontmatter
titlestringmandatoryThe title of this page in the menu and when Quiqr App refers to this page
filestring: relative path to filemandatoryThe path to the file. This is the data storage. Can be data/somefile.{json,toml,yaml} or content/somefile.md
previewUrlstring: relative url path to the websiteoptionalWhen set, this path is used to preview the page
hidePreviewIconbooleanoptionalHide Preview Icon which opens the page in the browser
hideExternalEditIconbooleanoptionalHide Enternal Editor Icon which opens the file in the OS Text Editor
hideSaveButtonbooleanoptionalHide form Save button
fieldsarray of dictionariesmandatoryThese are the form input fields.

Example #

./model/base.
     
singles:
- dataformat: toml
  fields:
  - key: description
    title: Description
    type: string
  - key: title
    title: Title
    type: string
  file: config.toml
  key: config
  title: Settings
[[singles]]
  dataformat = "toml"
  file = "config.toml"
  key = "config"
  title = "Settings"

  [[singles.fields]]
    key = "description"
    title = "Description"
    type = "string"

  [[singles.fields]]
    key = "title"
    title = "Title"
    type = "string"
{
   "singles": [
      {
         "dataformat": "toml",
         "fields": [
            {
               "key": "description",
               "title": "Description",
               "type": "string"
            },
            {
               "key": "title",
               "title": "Title",
               "type": "string"
            }
         ],
         "file": "config.toml",
         "key": "config",
         "title": "Settings"
      }
   ]
}