fix(docs): update Hugo docs (#4989)

This commit is contained in:
Vladislav Shkodin 2021-02-22 16:52:27 +02:00 committed by GitHub
parent 0da3c833f9
commit f0a8b376a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,7 +223,7 @@ CMS.registerEditorComponent({
widget: "string"
},
],
pattern: /{{< gist ([a-zA-Z0-9]+) ([a-zA-Z0-9]+) >}}/,
pattern: /^{{< gist ([a-zA-Z0-9]+) ([a-zA-Z0-9]+) >}}/,
fromBlock: function(match) {
return {
username: match[1],
@ -234,7 +234,7 @@ CMS.registerEditorComponent({
return `{{< gist ${obj.username} ${obj.gid} >}}`;
},
toPreview: function(obj) {
return `{{< gist ${obj.username} ${obj.gid} >}}`;
return '<a href="https://gist.github.com/' + obj.username + '/' + obj.id + '">gist</a>';
},
});
```
@ -243,4 +243,4 @@ CMS.registerEditorComponent({
![Gist](/img/hugo_shortcode_gist.png "Gist")
For getting started quickly you can refer to this amazing prebuilt resource of [hugo shortcodes editor components](https://github.com/sharadcodes/hugo-shortcodes-netlify-cms)!
For getting started quickly you can refer to this amazing prebuilt resource of [hugo shortcodes editor components](https://github.com/sharadcodes/hugo-shortcodes-netlify-cms)!