Skip to content

Commit

Permalink
test: script for previews in its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
hetd54 committed Aug 13, 2024
1 parent f695742 commit 72d1365
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 8 additions & 0 deletions public/admin/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PeoplePreview } from "./previews/PeoplePreview.js"
import { NewsPreview } from "./previews/NewsPreview.js"

window.CMS.init()
window.CMS.registerPreviewStyle("../src/styles/global.css")

window.CMS.registerPreviewTemplate("people", PeoplePreview)
window.CMS.registerPreviewTemplate("news", NewsPreview)
11 changes: 1 addition & 10 deletions public/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,7 @@
<body>
<!-- Include the script that builds the page and powers Static CMS -->
<script src="https://unpkg.com/@staticcms/app@^4.0.0/dist/static-cms-app.js"></script>
<script type="module">
import { PeoplePreview } from "./PeoplePreview.js"
import { NewsPreview } from "./NewsPreview.js"

window.CMS.init()
window.CMS.registerPreviewStyle("../src/styles/global.css")

window.CMS.registerPreviewTemplate("people", PeoplePreview)
window.CMS.registerPreviewTemplate("news", NewsPreview)

<script type="module" src="./config.js">
</script>
</body>
</html>
File renamed without changes.
File renamed without changes.

0 comments on commit 72d1365

Please sign in to comment.