-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP (docs driven development) - Preview API #1311
Conversation
Deploy preview for netlify-cms-www ready! Built with commit 95e64b3 |
Deploy preview for cms-demo ready! Built with commit 95e64b3 |
14238e7
to
5d13e68
Compare
```html | ||
<div> | ||
<h1>Blog Post</h1> | ||
A *brand new* post. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description
above has two asterisks (**brand new**
) but there's only one here (*brand new*
).
5d13e68
to
27010c8
Compare
``` | ||
|
||
Registering a template may require other arguments depending on your template compiler. For more | ||
information on `registerPreviewTemplate`, check out the [API docs](#), as well as the docs for your |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we allow the preview template to be pulled in via a filename?
CMS.registerPreviewTemplate('blog', 'template.hbs');
If so, do we need to allow an option/switch for that so that we can easily differentiate between filenames and templates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't planning on it - the case where someone can actually use production templates in the CMS is pretty rare. It's most likely to be possible for projects using React components as templates, but in that case the file is going to be ES6/JSX, so the CMS still can't use it as is. We'd also have to grab templates via GitHub since they wouldn't be available in the deployed site.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this could also be used buy sites that do have custom templates for the CMS, but no build system for easily importing them in a registration script. This is worth considering.
02ea75b
to
4585108
Compare
04a4a71
to
b9ecf1c
Compare
f84b170
to
f02774a
Compare
return ( | ||
<div> | ||
<h1>{fields.title.value}</h1> | ||
<div>{collections.authors.fields} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is missing the </div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
We'll likely change look and feel and improve presentation before this goes out - the big thing to review here is the new API itself, and whether it's adequate.
The big change so far: Current Proposed What this means
Other benefits
Notes
(Developing) |
Closing as stale, will re-open when ready. |
Alrighty folks, we're going to go docs driven for the preview API!
You do not have to be a maintainer to review this and help shape the API.
Related to #1041.
How to review:
I'll link live pages that are ready for review below. Feel free to go over files in this PR that are not linked below, just know that they're not considered ready for any actual review.
Let's get it 💪
Ready for Review