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

Commit

Permalink
Update admin.html
Browse files Browse the repository at this point in the history
  • Loading branch information
KaneFreeman committed Apr 21, 2023
1 parent 697213f commit 1c115e4
Showing 1 changed file with 36 additions and 39 deletions.
75 changes: 36 additions & 39 deletions src/static/admin.html
Original file line number Diff line number Diff line change
@@ -1,42 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Content Manager</title>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^2.0.0/dist/main.css" />
</head>
<body>
<!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/@staticcms/app@^2.0.0/dist/static-cms-app.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<script type="module">
import htm from "https://unpkg.com/htm?module";
const html = htm.bind(h);
const PostPreview = createClass({
render: function () {
const { entry, widgetFor } = this.props;
const image = entry.data.cover;
let imageMarkup = "";
if (image) {
imageMarkup = html`<div><img src="${image.toString()}" /></div>`;
}
return html`
<div>
<h1 className="blogTitle">${entry.data.title}</h1>
<caption className="blogSubTitle">
${entry.data.subtitle}
</caption>
${imageMarkup}
<div className="text">${widgetFor("body")}</div>
</div>
`;
},
});
CMS.registerPreviewStyle("/preview.css");
CMS.registerPreviewTemplate("pages", PostPreview);
CMS.init();
</script>
</body>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Content Manager</title>
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^2.0.0/dist/main.css" />
</head>
<body>
<!-- Include the script that builds the page and powers Netlify CMS -->
<script src="https://unpkg.com/@staticcms/app@^2.0.0/dist/static-cms-app.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<script type="module">
import htm from 'https://unpkg.com/htm?module';
const html = htm.bind(h);
const PostPreview = ({ entry, widgetFor }) => {
const image = entry.data.cover;
let imageMarkup = '';
if (image) {
imageMarkup = html`<div><img src="${image.toString()}" /></div>`;
}
return html`
<div>
<h1 className="blogTitle">${entry.data.title}</h1>
<caption className="blogSubTitle">
${entry.data.subtitle}
</caption>
${imageMarkup}
<div className="text">${widgetFor('body')}</div>
</div>
`;
};
CMS.registerPreviewStyle('/preview.css');
CMS.registerPreviewTemplate('pages', PostPreview);
CMS.init();
</script>
</body>
</html>

0 comments on commit 1c115e4

Please sign in to comment.