Skip to content
Snippets Groups Projects
Commit 01627c26 authored by Emmanuel Salomon's avatar Emmanuel Salomon :fist:
Browse files

netlify: Added previews + fixes in conifg

parent 6a966cab
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -36,7 +36,7 @@ collections: ...@@ -36,7 +36,7 @@ collections:
preview_path: "{{slug}}" preview_path: "{{slug}}"
fields: fields:
- { label: Titre, name: title, widget: string } - { label: Titre, name: title, widget: string }
- { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans la recherche. } - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans les résultats de recherche. }
- { label: Contenu, name: body, widget: markdown } - { label: Contenu, name: body, widget: markdown }
- name: blog - name: blog
...@@ -71,6 +71,7 @@ collections: ...@@ -71,6 +71,7 @@ collections:
format: frontmatter format: frontmatter
folder: content/lexique folder: content/lexique
create: true create: true
preview_path: "lexique/{{slug}}"
fields: fields:
- { label: Titre, name: title, widget: string } - { label: Titre, name: title, widget: string }
- { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans le lexique et dans les bulles d'info. } - { label: Résumé, name: description, widget: string, hint: Le résumé est affiché dans le lexique et dans les bulles d'info. }
......
...@@ -83,5 +83,25 @@ ...@@ -83,5 +83,25 @@
<body> <body>
<!-- Include the script that builds the page and powers Netlify CMS --> <!-- 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://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<script>
CMS.registerPreviewStyle('/admin/app.css')
var PagePreview = createClass({
render: function () {
var entry = this.props.entry
return h(
'div',
{},
h('div', { className: 'prose' }, this.props.widgetFor('body'))
)
},
})
CMS.registerPreviewTemplate('pages', PagePreview)
CMS.registerPreviewTemplate('blog', PagePreview)
CMS.registerPreviewTemplate('faq', PagePreview)
CMS.registerPreviewTemplate('lexique', PagePreview)
</script>
</body> </body>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment