Skip to content
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

Add comments on fields/collections #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/cms/previews/Story.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const Story = ({ entry, widgetFor }) => {
<StyleInjector>
<div>
<h2>Card Preview</h2>
<small>
You may see characters that shoudn't be here... Don't worry, they won't appear in the live
website!
</small>
Comment on lines +23 to +26
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part will be confusing ...
What kind of "characters that shoudn't be here" are we talking about ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, I think you're talking about the markdown formatting characters.

I would clarify that.
Something like "You will see formatting characters (* , #, ...) ...".
Or could you make the preview work like it works on the Stories page ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Markers' are not shown in the excerpt of a story, it's just plaintext on the live website. Gatsby is using a tool to convert markdown into text (a plugin for remark, I think) but I didn't really look into it.

<StoryCard title={data.title} date={data.date} excerpt={excerpt} />
</div>
<hr />
Expand Down
19 changes: 18 additions & 1 deletion static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ collections:
create: true
identifier_field: name
slug: '{{name}}'
description:
"Click on the button 'New Activity' to add an activity or modify an existing activity by choosing one in the list below.
You can 'pin' an activity by heading over to 'Pages > Home > Activities Section > Featured Activities'."
fields:
- { label: 'Name', name: 'name', widget: 'string' }
- { label: 'Logo', name: 'logo', widget: 'image', allow_multiple: false }
Expand Down Expand Up @@ -78,6 +81,7 @@ collections:
widget: 'image',
allow_multiple: false,
required: false,
hint: 'Your picture is automatically transformed to fit a certain size and a grayscale effect is applied.',
}
- label: 'Contact info'
name: 'contact_info'
Expand Down Expand Up @@ -114,6 +118,9 @@ collections:
public_folder: ''
create: true
slug: '{{year}}{{month}}{{day}}-{{title}}'
description:
"Click on the button 'New Story' to create a story or modify an existing story by choosing one in the list below.
You can 'pin' a story by heading over to 'Pages > Home > Stories Section > Featured Stories'."
fields:
- label: 'Date'
name: 'date'
Expand All @@ -125,7 +132,13 @@ collections:
- { label: 'Author', name: 'author', widget: string }
- { label: 'Title', name: 'title', widget: string }
- { label: 'Article', name: 'body', widget: markdown }
- { label: 'Excerpt', name: 'excerpt', widget: text, required: false }
- {
label: 'Excerpt',
name: 'excerpt',
widget: text,
required: false,
hint: "Although the excerpt of the story can be generated automatically, it's done by taking the few first characters of the story body.",
}
- label: 'Tags'
name: 'tags'
widget: 'relation'
Expand Down Expand Up @@ -193,6 +206,7 @@ collections:
add_to_top: true
label_singular: 'an activity'
summary: '{{field.activity}}'
hint: 'Only a maximum of 3 activities can be shown on the homepage. But you can always remove and replace.'
field:
{
label: 'Activity',
Expand Down Expand Up @@ -243,6 +257,7 @@ collections:
add_to_top: true
label_singular: 'a story'
summary: '{{field.story}}'
hint: 'Only a maximum of 3 stories can be shown on the homepage. But you can always remove and replace.'
field:
{
label: 'Story',
Expand Down Expand Up @@ -334,6 +349,7 @@ collections:
widget: 'image',
allow_multiple: false,
required: false,
hint: 'Your picture is automatically transformed to fit a certain size and a grayscale effect is applied.',
}
- label: 'Contact info'
name: 'contact_info'
Expand All @@ -358,6 +374,7 @@ collections:
widget: 'image',
allow_multiple: false,
required: false,
hint: 'Your picture is automatically transformed to fit a certain size and a grayscale effect is applied.',
}
- label: 'Contact info'
name: 'contact_info'
Expand Down