My Blog, build with Norgolith blog.ladas552.me
blog

0.1.3 content schema in toml

+18
+18
Rattman/norgolith.toml
··· 7 7 [highlighter] 8 8 enable = false 9 9 # engine = 'prism' # Can be 'prism' or 'hljs'. Defaults to 'prism' 10 + 11 + # Content Scheme 12 + ## Global options 13 + [content_schema] 14 + required = [ "title", "description", "authors", "categories" ] 15 + 16 + ## field rules 17 + [content_schema.fields] 18 + title = { type = "string", max_length = 30 } 19 + description = { type = "string", max_length = 100 } 20 + categories = { type = "array", items = { type = "string" }, min_items = 1 } 21 + 22 + # publish date for '/posts' 23 + [content_schema.posts.rules] 24 + if = { draft = false } 25 + then = { required = ["publish_date"] } 26 + 27 +