|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
3 | | - <head> |
4 | | - <meta charset="utf-8" /> |
5 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
6 | | - <title>Content Manager</title> |
7 | | - <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> |
8 | | - <link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^2.0.0/dist/main.css" /> |
9 | | - </head> |
10 | | - <body> |
11 | | - <!-- Include the script that builds the page and powers Netlify CMS --> |
12 | | - <script src="https://unpkg.com/@staticcms/app@^2.0.0/dist/static-cms-app.js"></script> |
13 | | - <script src=" //cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js" ></script> |
14 | | - <script type="module"> |
15 | | - import htm from "https://unpkg.com/htm?module"; |
16 | | - const html = htm.bind(h); |
17 | | - const PostPreview = createClass({ |
18 | | - render: function () { |
19 | | - const { entry, widgetFor } = this.props; |
20 | | - const image = entry.data.cover; |
21 | | - let imageMarkup = ""; |
22 | | - if (image) { |
23 | | - imageMarkup = html`<div><img src="${image.toString()}" /></div>`; |
24 | | - } |
25 | | - return html` |
26 | | - <div> |
27 | | - <h1 className="blogTitle">${entry.data.title}</h1> |
28 | | - <caption className="blogSubTitle"> |
29 | | - ${entry.data.subtitle} |
30 | | - </caption> |
31 | | - ${imageMarkup} |
32 | | - <div className="text">${widgetFor("body")}</div> |
33 | | - </div> |
34 | | - `; |
35 | | - }, |
36 | | - }); |
37 | | - CMS.registerPreviewStyle("/preview.css"); |
38 | | - CMS.registerPreviewTemplate("pages", PostPreview); |
39 | | - CMS.init(); |
40 | | - </script> |
41 | | - </body> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 6 | + <title>Content Manager</title> |
| 7 | + <script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script> |
| 8 | + <link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^2.0.0/dist/main.css" /> |
| 9 | + </head> |
| 10 | + <body> |
| 11 | + <!-- Include the script that builds the page and powers Netlify CMS --> |
| 12 | + <script src="https://unpkg.com/@staticcms/app@^2.0.0/dist/static-cms-app.js"></script> |
| 13 | + <script src=" //cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js" ></script> |
| 14 | + <script type="module"> |
| 15 | + import htm from 'https://unpkg.com/htm?module'; |
| 16 | + const html = htm.bind(h); |
| 17 | + const PostPreview = ({ entry, widgetFor }) => { |
| 18 | + const image = entry.data.cover; |
| 19 | + let imageMarkup = ''; |
| 20 | + if (image) { |
| 21 | + imageMarkup = html`<div><img src="${image.toString()}" /></div>`; |
| 22 | + } |
| 23 | + return html` |
| 24 | + <div> |
| 25 | + <h1 className="blogTitle">${entry.data.title}</h1> |
| 26 | + <caption className="blogSubTitle"> |
| 27 | + ${entry.data.subtitle} |
| 28 | + </caption> |
| 29 | + ${imageMarkup} |
| 30 | + <div className="text">${widgetFor('body')}</div> |
| 31 | + </div> |
| 32 | + `; |
| 33 | + }; |
| 34 | + CMS.registerPreviewStyle('/preview.css'); |
| 35 | + CMS.registerPreviewTemplate('pages', PostPreview); |
| 36 | + CMS.init(); |
| 37 | + </script> |
| 38 | + </body> |
42 | 39 | </html> |
0 commit comments