Skip to content

Commit

Permalink
Fix issues with CMS due to version upgrades of html-webpack-plugin an…
Browse files Browse the repository at this point in the history
…d date-fns.
  • Loading branch information
cgc committed Sep 15, 2022
1 parent da9b59e commit 97a313e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion site/static/admin/index.html → src/cms.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<script src="https://identity-js.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
<body>
<script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
<script src="<%= htmlWebpackPlugin.publicPath %>/<%= htmlWebpackPlugin.files.js[1] %>"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/js/cms-preview-templates/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class PostPreview extends React.Component {
return <div className="mw6 center ph3 pv4">
<h1 className="f2 lh-title b mb3">{ entry.getIn(["data", "title"])}</h1>
<div className="flex justify-between grey-3">
<p>{ format(entry.getIn(["data", "date"]), "ddd, MMM D, YYYY") }</p>
<p>{ format(entry.getIn(["data", "date"]), "iii, LLL d, yyyy") }</p>
<p>Read in x minutes</p>
</div>
<div className="cms mw6">
Expand Down
5 changes: 5 additions & 0 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,10 @@ module.exports = {
to: "fonts/",
}]
}),
new HtmlWebpackPlugin({
filename: 'admin/index.html',
template: 'src/cms.html',
inject: false,
}),
]
};

0 comments on commit 97a313e

Please sign in to comment.