Blog (single file)

Example 1: minimal one file blog #

Here’s an example model/base-file containing a minimal configuration for a blog website.

./model/base.
     
build:
- config: config.toml
  key: default
collections:
- dataformat: yaml
  extension: md
  fields:
  - key: draft
    title: Draft
    type: boolean
  - key: title
    title: Title
    type: string
  - extensions:
    - jpg
    - png
    - jpeg
    - pdf
    - svg
    fields:
    - key: thumb
      title: Thumb
      type: bundle-image-thumbnail
    key: page_related_images
    path: ""
    title: Page related images
    type: bundle-manager
  - key: mainContent
    title: Main content
    type: markdown
  - key: publishdate
    title: Publishdate
    type: hidden
  - key: tags
    title: Tags
    type: chips
  folder: content/post/
  itemtitle: Post
  key: c__post
  title: Posts
hugover: extended_0.76.5
menu:
- key: singles
  menuItems:
  - key: s__about
  title: Pages
- key: collections
  menuItems:
  - key: c__post
  title: Groups
- key: general
  menuItems:
  - key: config
  title: General
serve:
- config: config.toml
  key: default
singles:
- dataformat: toml
  fields:
  - key: description
    title: Description
    type: string
  - key: title
    title: Title
    type: string
  - fields:
    - key: author
      title: Author
      type: string
    - key: dateFormat
      title: Date format
      type: string
    - key: description
      title: Description
      type: string
    - key: paginationSinglePost
      title: Pagination single post
      type: boolean
    - key: readMore
      title: Read more
      type: boolean
    - key: style
      title: Style
      type: string
    groupdata: true
    key: params
    title: Params
    type: section
  file: config.toml
  key: config
  title: Settings
- dataformat: yaml
  fields:
  - key: title
    title: Title
    type: string
  - key: description
    title: Description
    type: string
  - extensions:
    - jpg
    - png
    - jpeg
    - pdf
    - svg
    fields:
    - key: thumb
      title: Thumb
      type: bundle-image-thumbnail
    key: page_related_images
    path: images/
    title: Page related images
    type: bundle-manager
  - key: mainContent
    title: Main content
    type: markdown
  file: content/about.md
  key: s__about
  previewUrl: /about/
  title: About
hugover = "extended_0.76.5"

[[build]]
  config = "config.toml"
  key = "default"

[[collections]]
  dataformat = "yaml"
  extension = "md"
  folder = "content/post/"
  itemtitle = "Post"
  key = "c__post"
  title = "Posts"

  [[collections.fields]]
    key = "draft"
    title = "Draft"
    type = "boolean"

  [[collections.fields]]
    key = "title"
    title = "Title"
    type = "string"

  [[collections.fields]]
    extensions = ["jpg", "png", "jpeg", "pdf", "svg"]
    key = "page_related_images"
    path = ""
    title = "Page related images"
    type = "bundle-manager"

    [[collections.fields.fields]]
      key = "thumb"
      title = "Thumb"
      type = "bundle-image-thumbnail"

  [[collections.fields]]
    key = "mainContent"
    title = "Main content"
    type = "markdown"

  [[collections.fields]]
    key = "publishdate"
    title = "Publishdate"
    type = "hidden"

  [[collections.fields]]
    key = "tags"
    title = "Tags"
    type = "chips"

[[menu]]
  key = "singles"
  title = "Pages"

  [[menu.menuItems]]
    key = "s__about"

[[menu]]
  key = "collections"
  title = "Groups"

  [[menu.menuItems]]
    key = "c__post"

[[menu]]
  key = "general"
  title = "General"

  [[menu.menuItems]]
    key = "config"

[[serve]]
  config = "config.toml"
  key = "default"

[[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.fields]]
    groupdata = true
    key = "params"
    title = "Params"
    type = "section"

    [[singles.fields.fields]]
      key = "author"
      title = "Author"
      type = "string"

    [[singles.fields.fields]]
      key = "dateFormat"
      title = "Date format"
      type = "string"

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

    [[singles.fields.fields]]
      key = "paginationSinglePost"
      title = "Pagination single post"
      type = "boolean"

    [[singles.fields.fields]]
      key = "readMore"
      title = "Read more"
      type = "boolean"

    [[singles.fields.fields]]
      key = "style"
      title = "Style"
      type = "string"

[[singles]]
  dataformat = "yaml"
  file = "content/about.md"
  key = "s__about"
  previewUrl = "/about/"
  title = "About"

  [[singles.fields]]
    key = "title"
    title = "Title"
    type = "string"

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

  [[singles.fields]]
    extensions = ["jpg", "png", "jpeg", "pdf", "svg"]
    key = "page_related_images"
    path = "images/"
    title = "Page related images"
    type = "bundle-manager"

    [[singles.fields.fields]]
      key = "thumb"
      title = "Thumb"
      type = "bundle-image-thumbnail"

  [[singles.fields]]
    key = "mainContent"
    title = "Main content"
    type = "markdown"
{
   "build": [
      {
         "config": "config.toml",
         "key": "default"
      }
   ],
   "collections": [
      {
         "dataformat": "yaml",
         "extension": "md",
         "fields": [
            {
               "key": "draft",
               "title": "Draft",
               "type": "boolean"
            },
            {
               "key": "title",
               "title": "Title",
               "type": "string"
            },
            {
               "extensions": [
                  "jpg",
                  "png",
                  "jpeg",
                  "pdf",
                  "svg"
               ],
               "fields": [
                  {
                     "key": "thumb",
                     "title": "Thumb",
                     "type": "bundle-image-thumbnail"
                  }
               ],
               "key": "page_related_images",
               "path": "",
               "title": "Page related images",
               "type": "bundle-manager"
            },
            {
               "key": "mainContent",
               "title": "Main content",
               "type": "markdown"
            },
            {
               "key": "publishdate",
               "title": "Publishdate",
               "type": "hidden"
            },
            {
               "key": "tags",
               "title": "Tags",
               "type": "chips"
            }
         ],
         "folder": "content/post/",
         "itemtitle": "Post",
         "key": "c__post",
         "title": "Posts"
      }
   ],
   "hugover": "extended_0.76.5",
   "menu": [
      {
         "key": "singles",
         "menuItems": [
            {
               "key": "s__about"
            }
         ],
         "title": "Pages"
      },
      {
         "key": "collections",
         "menuItems": [
            {
               "key": "c__post"
            }
         ],
         "title": "Groups"
      },
      {
         "key": "general",
         "menuItems": [
            {
               "key": "config"
            }
         ],
         "title": "General"
      }
   ],
   "serve": [
      {
         "config": "config.toml",
         "key": "default"
      }
   ],
   "singles": [
      {
         "dataformat": "toml",
         "fields": [
            {
               "key": "description",
               "title": "Description",
               "type": "string"
            },
            {
               "key": "title",
               "title": "Title",
               "type": "string"
            },
            {
               "fields": [
                  {
                     "key": "author",
                     "title": "Author",
                     "type": "string"
                  },
                  {
                     "key": "dateFormat",
                     "title": "Date format",
                     "type": "string"
                  },
                  {
                     "key": "description",
                     "title": "Description",
                     "type": "string"
                  },
                  {
                     "key": "paginationSinglePost",
                     "title": "Pagination single post",
                     "type": "boolean"
                  },
                  {
                     "key": "readMore",
                     "title": "Read more",
                     "type": "boolean"
                  },
                  {
                     "key": "style",
                     "title": "Style",
                     "type": "string"
                  }
               ],
               "groupdata": true,
               "key": "params",
               "title": "Params",
               "type": "section"
            }
         ],
         "file": "config.toml",
         "key": "config",
         "title": "Settings"
      },
      {
         "dataformat": "yaml",
         "fields": [
            {
               "key": "title",
               "title": "Title",
               "type": "string"
            },
            {
               "key": "description",
               "title": "Description",
               "type": "string"
            },
            {
               "extensions": [
                  "jpg",
                  "png",
                  "jpeg",
                  "pdf",
                  "svg"
               ],
               "fields": [
                  {
                     "key": "thumb",
                     "title": "Thumb",
                     "type": "bundle-image-thumbnail"
                  }
               ],
               "key": "page_related_images",
               "path": "images/",
               "title": "Page related images",
               "type": "bundle-manager"
            },
            {
               "key": "mainContent",
               "title": "Main content",
               "type": "markdown"
            }
         ],
         "file": "content/about.md",
         "key": "s__about",
         "previewUrl": "/about/",
         "title": "About"
      }
   ]
}