Git CMS Knowledge Base

How can we help?

Huong dan day du ve ket noi GitHub repository, cau hinh cms.config.json, tao content type, khai bao fields, quan ly media va viet Markdown/MDX trong Git CMS.

12

Guides

5

Core areas

27

Field types

GitHub

Storage

Browse by Category

Cau truc category theo phong cach SupportGenix Docs.

View all

Getting Started

Ket noi repo, chon branch va mo Dashboard.

Connect RepositoryDashboardConfig path

Configuration

Cau hinh cms.config.json, collections, placements va rules.

Config BuilderFieldsLocation Rules

Content Editing

Tao/sua Markdown, slug, permalink va frontmatter.

EditorSlugMarkdown file

Assets

Quan ly image/gallery, upload va media folder.

Image fieldMedia pageSEO rename

Overview

Git CMS la gi?

Git CMS la CMS quan ly Markdown/MDX va media truc tiep trong GitHub repository. Du lieu content nam trong repo, lich su thay doi nam trong commit, con database cua app chi luu user, workspace, subscription, repo connection va quyen truy cap.

Editor duoc tao tu cms.config.json. Ban co the dinh nghia nhieu content type, nhieu field, vi tri field, rule hien thi, permalink, media folder va cach luu frontmatter.

Connect Repository

  • GitHub repositories: chon repo co quyen push, maintain hoac admin.
  • Owner / Repository: tu nhan dang theo repo da chon, khong can nhap tay.
  • Branch: chon bang modal cay thu muc, ho tro branch co dau /.
  • Config path: duong dan file config, mac dinh cms.config.json.
  • Create default config if missing: tao config mau neu repo chua co file config.

Config Builder

Config Builder giup sua cms.config.json bang UI, dong thoi van cho phep sua JSON truc tiep.

  • Read JSON: doc lai JSON vao builder.
  • Save config: validate config va commit len GitHub.
  • Add content type: tao collection moi.
  • Add field: them field moi vao collection dang chon.

Path Picker

Trong content type builder, Path duoc chon bang cay thu muc cua repo. Khi chon folder, Name va Label se tu dong sinh theo ten folder.

  • Name la khoa ky thuat cua collection va dang readonly.
  • Label la ten hien thi va co the doi theo y thich.
  • Path la folder chua file Markdown/MDX cua collection.

Content Type / Collection

{
  "name": "blogs",
  "label": "Blogs",
  "path": "src/content/blogs",
  "format": "md",
  "bodyEditor": "split",
  "showPermalink": true,
  "fields": []
}

bodyEditor chon cach soan body: classic/visual, markdown, hoac split de hien song song va dong bo.

showPermalink cho phep an/hien panel permalink mac dinh trong editor.

Field Types Reference

Field Type Ghi chu
Text text Gop Text, Text Area, Number va Email; chon bang textMode.
Image / Gallery image Chon mot hoac nhieu anh tu media folder; bat multiple va maxItems khi can gallery.
oEmbed oembed Link video, iframe, YouTube, Vimeo hoac embed URL.
Choice choice Gop Select, Checkbox va Radio Button; chon cach hien thi bang choiceMode.
True / False boolean Bat/tat, co/khong, dung/sai.
Link link Nhap URL lien ket.
Taxonomy taxonomy Chon danh muc, tag hoac taxonomy tuy chinh; can options neu cau hinh tinh.
Relationship relationship Quan he toi nhieu bai viet/CPT; luu dang JSON/list.
Google Map google_map Nhap toa do, dia chi hoac du lieu ban do.
Date date Gop ngay, ngay gio va gio phut; ho tro ISO, dd/MM/yyyy, yyyy-MM-dd, HH:mm hoac custom format.
Accordion Tab group Gom field lien quan; Accordion 1-20 muc, Tab 2-5 tab, dat field con vao tung muc.
Repeater repeater Lap lai nhom field; nhap/luu dang JSON.
Flexible Content flexible Nhieu layout linh hoat; nhap/luu dang JSON.
Clone clone Tai su dung field hoac field group da co.

Field text dung textMode de chon text, textarea, number hoac email.

Field date dung dateMode de chon date, datetime hoac time. Dung dateFormat la iso hoac custom pattern nhu dd/MM/yyyy HH:mm; bat autoUpdate cho field Ngay cap nhat.

Field Placements

main - Main editor

Hien trong cot chinh, truoc hoac quanh vung soan noi dung.

sidebar - Sidebar

Hien trong cot phai, phu hop title, draft, date, SEO nhanh.

seo - SEO panel

Nhom field SEO o cot chinh.

advanced - Advanced panel

Nhom field nang cao o cot chinh.

tab - Custom tab

Dung them thuoc tinh tab de tao nhom rieng.

Location Rules

Moi rule viet mot dong trong builder. Neu khong co rule, field hien mac dinh.

all=
content_type=blog
page=home
post=hello-world
category=news
taxonomy=tag:featured
slug=about-us
path=src/content/blogs

all

Hien o moi noi.

content_type / collection / type

Match theo collection name/label/path, vi du content_type=blog.

page

Hien khi la page hoac slug/page tuong ung.

post / entry

Hien khi la post/entry hoac slug tuong ung.

slug

Match slug hien tai.

path

Match collection path.

category

Match category/categories trong frontmatter.

taxonomy

Match taxonomy field, vi du taxonomy=tag:featured.

Content Editor

  • Visual: soan nhanh body Markdown bang toolbar.
  • Markdown file: sua truc tiep frontmatter va body.
  • bodyEditor: dung classic/visual de chi hien editor co toolbar, markdown de chi hien file Markdown, hoac split de hien hai editor song song va dong bo.
  • Main fields: hien truoc vung Visual/Markdown editor.
  • Sidebar fields: hien trong cot phai.
  • SEO / Advanced / Tab: nhom field theo placement.

Field body chinh duoc xac dinh khi type la text hoac textarea va name/label la body, content, markdown hoac noi-dung.

Media

  • media.input: folder luu file upload trong repo.
  • media.output: URL public tuong ung tren website.
  • Image / Gallery: chon anh trong hop Media; bat multiple de luu nhieu anh va dung maxItems neu can gioi han.
  • Media page: xem asset, upload, doi ten SEO, toi uu va xoa file.

Full Config Example

{
  "media": {
    "input": "public/uploads",
    "output": "/uploads"
  },
  "collections": [
    {
      "name": "blogs",
      "label": "Blogs",
      "path": "src/content/blogs",
      "format": "md",
      "bodyEditor": "split",
      "showPermalink": true,
      "fields": [
        {
          "name": "title",
          "label": "Tieu de",
          "type": "text",
          "textMode": "text",
          "placement": "sidebar",
          "required": true,
          "locationRules": [{ "type": "all", "operator": "is" }]
        },
        {
          "name": "slug",
          "label": "Slug",
          "type": "text",
          "textMode": "text",
          "placement": "sidebar"
        },
        {
          "name": "description",
          "label": "Mo ta SEO",
          "type": "text",
          "textMode": "textarea",
          "placement": "seo"
        },
        {
          "name": "image",
          "label": "Anh dai dien",
          "type": "image",
          "placement": "media"
        },
        {
          "name": "updatedAt",
          "label": "Ngay cap nhat",
          "type": "date",
          "dateMode": "datetime",
          "dateFormat": "iso",
          "autoUpdate": true,
          "placement": "sidebar"
        },
        {
          "name": "body",
          "label": "Noi dung",
          "type": "text",
          "textMode": "textarea",
          "placement": "main"
        }
      ]
    }
  ]
}

Workflow

  1. Ket noi repository va branch.
  2. Mo Config file, chon Path bang folder picker cho content type.
  3. Them fields va dat placement/location rules.
  4. Save config de commit cms.config.json.
  5. Vao Content, tao hoac sua bai viet.
  6. Upload media neu can, dien field, sua Markdown file neu muon.
  7. Save de commit noi dung len GitHub.

Troubleshooting

  • Field khong hien: kiem tra placement, locationRules, va field co bi nhan la body chinh khong.
  • Sidebar field an: kiem tra placement, location rules, va field co phu hop collection hien tai hay khong.
  • Slug khong doi: neu khai bao field slug, hay sua field do hoac frontmatter slug trong Markdown file.
  • Config khong save: JSON phai hop le va schema field type/placement phai dung.
  • Khong thay folder trong Path picker: dam bao repository da ket noi dung branch va token GitHub co quyen doc repo.

Was this helpful?

Phan feedback duoc luu localStorage, theo dung tinh than docs theme khong can backend.