Skip to content

Commit f676832

Browse files
committed
Widget improvements
1 parent 7cd558c commit f676832

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

static/admin/index.html

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,11 @@
142142
id: "toc",
143143
label: "Table of Contents",
144144
pattern: /^{{<\s*toc\s*>}}/,
145-
fromBlock: function(match) {
146-
return {
147-
authors: match
148-
};
149-
},
150145
toBlock: function(obj) {
151146
return `{{< toc >}}`;
152147
},
153148
toPreview: function(obj) {
154-
return '<b>TABLE OF CONTENTS WILL BE HERE</b>';
149+
return '<hr><b>TABLE OF CONTENTS WILL BE HERE</b><hr>';
155150
},
156151
});
157152
// podcast_player
@@ -186,6 +181,7 @@
186181
return '<audio controls src="/podcast/episodes/'+obj.direct+'"></audio>';
187182
},
188183
});
184+
189185
// Youtube
190186
CMS.registerEditorComponent({
191187
id: "youtube",
@@ -210,6 +206,19 @@
210206
},
211207
});
212208

209+
// Children
210+
CMS.registerEditorComponent({
211+
id: "children",
212+
label: "Children",
213+
pattern: /^{{<\s*children\s*>}}/,
214+
toBlock: function() {
215+
return `{{< children >}}`;
216+
},
217+
toPreview: function() {
218+
return '<hr><b>Child pages are displayed here</b><hr>';
219+
},
220+
});
221+
213222
// Device boxes
214223
CMS.registerEditorComponent({
215224
id: 'flexbox',
@@ -367,7 +376,7 @@ <h4 style="margin:0 0 4px;font-size:1em;">${b.title}</h4>
367376
{
368377
name: "body",
369378
label: "Content",
370-
widget: "text",
379+
widget: "markdown",
371380
default: "",
372381
},
373382
],

0 commit comments

Comments
 (0)