Skip to content

Commit

Permalink
Merge pull request #83 from brown-ccv/fix-live-static-cms
Browse files Browse the repository at this point in the history
test: link config explicitly in head
  • Loading branch information
galenwinsor authored Aug 13, 2024
2 parents a59458d + 48c17ff commit 73289e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 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)
14 changes: 3 additions & 11 deletions public/admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,13 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^4.0.0/dist/main.css" />
<link href="/admin/config.yml" type="text/yaml" rel="cms-config-url" />

<title>Content Manager</title>
</head>
<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 "./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)

</script>
<script type="module" src="/admin/config.js"></script>
</body>
</html>

0 comments on commit 73289e4

Please sign in to comment.