Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

Commit aa73abe

Browse files
committed
Update to static cms 2.0.0
1 parent d9dc1bc commit aa73abe

File tree

1 file changed

+42
-41
lines changed

1 file changed

+42
-41
lines changed

src/static/admin.html

+42-41
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
1-
<!DOCTYPE html>
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-
</head>
9-
<body>
10-
<!-- Include the script that builds the page and powers Netlify CMS -->
11-
<script src="https://unpkg.com/@staticcms/core@%5E1.0.0/dist/static-cms-app.js"></script>
12-
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
13-
<script type="module">
14-
import htm from "https://unpkg.com/htm?module";
15-
const html = htm.bind(h);
16-
const PostPreview = createClass({
17-
render: function () {
18-
const { entry, widgetFor } = this.props;
19-
const image = entry.data.cover;
20-
let imageMarkup = "";
21-
if (image) {
22-
imageMarkup = html`<div><img src="${image.toString()}" /></div>`;
23-
}
24-
return html`
25-
<div>
26-
<h1 className="blogTitle">${entry.data.title}</h1>
27-
<caption className="blogSubTitle">
28-
${entry.data.subtitle}
29-
</caption>
30-
${imageMarkup}
31-
<div className="text">${widgetFor("body")}</div>
32-
</div>
33-
`;
34-
},
35-
});
36-
CMS.registerPreviewStyle("/preview.css");
37-
CMS.registerPreviewTemplate("pages", PostPreview);
38-
CMS.init();
39-
</script>
40-
</body>
41-
</html>
1+
<!DOCTYPE html>
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/core@^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>
42+
</html>

0 commit comments

Comments
 (0)