This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
697213f
commit 1c115e4
Showing
1 changed file
with
36 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |