gcg-website/static/admin/index.html
2020-10-02 15:51:30 +02:00

39 lines
1.1 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GCG WebAdmin</title>
</head>
<body>
<!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<script src="https://sharadcodes.github.io/hugo-shortcodes-netlify-cms/dist/hugo_shortcodes_netlify_cms.js"></script>
<script>
CMS.registerPreviewStyle("https://eesev9ie.github.io/style.css");
CMS.registerEditorComponent({
id: "gallery",
label: "Bildergallerie",
fields: [{
name: "dir",
label: "Ordner",
widget: "string"
},
],
pattern: /{{< gallery dir="([a-zA-Z0-9]+)" />}}/,
fromBlock: function(match) {
return {
username: dir[1],
};
},
toBlock: function(obj) {
return `{{< gallery dir="${obj.dir}" />}}`;
},
toPreview: function(obj) {
return `{{< gallery dir="${obj.dir}" />}}`;
},
});
</script>
</body>
</html>