Skip to content

Commit

Permalink
feat: add some page metadata models
Browse files Browse the repository at this point in the history
  • Loading branch information
buuhuu committed Nov 12, 2024
1 parent fcd2306 commit e038461
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 15 deletions.
46 changes: 37 additions & 9 deletions component-models.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
"id": "page-metadata",
"fields": [
{
"component": "text",
"component": "select",
"name": "template",
"label": "Template"
"label": "Template",
"options": [
{
"name": "Default",
"value": ""
},
{
"name": "Article",
"value": "article"
}
]
},
{
"component": "container",
Expand All @@ -25,9 +35,19 @@
"id": "article-metadata",
"fields": [
{
"component": "text",
"component": "select",
"name": "template",
"label": "Template"
"label": "Template",
"options": [
{
"name": "Default",
"value": ""
},
{
"name": "Article",
"value": "article"
}
]
},
{
"component": "container",
Expand All @@ -38,13 +58,21 @@
"component": "text",
"name": "og:title",
"label": "Title"
},
{
"component": "text",
"name": "article:author",
"label": "Author",
"condition": {
"===": [
{
"var": "template"
},
"author"
]
}
}
]
},
{
"component": "text",
"name": "articleAuthor",
"label": "Author"
}
]
},
Expand Down
40 changes: 34 additions & 6 deletions models/_page.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
"id": "page-metadata",
"fields": [
{
"component": "text",
"component": "select",
"name": "template",
"label": "Template"
"label": "Template",
"options": [
{
"name": "Default",
"value": ""
},
{
"name": "Article",
"value": "article"
}
]
},
{
"component": "container",
Expand All @@ -26,12 +36,30 @@
"id": "article-metadata",
"fields": [
{
"...": "#/models/page-metadata/fields"
"...": "#/models/page-metadata/fields/template"
},
{
"component": "text",
"name": "articleAuthor",
"label": "Author"
"component": "container",
"name": "social",
"label": "Social",
"fields": [
{
"...": "#/models/page-metadata/fields/social/fields"
},
{
"component": "text",
"name": "article:author",
"label": "Author",
"condition": {
"===": [
{
"var": "template"
},
"author"
]
}
}
]
}
]
}
Expand Down

0 comments on commit e038461

Please sign in to comment.