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 support for an "authors" collection #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 18 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ collections: # A list of collections the CMS should be able to edit
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Post Excerpt (used in archive)", name: "excerpt", widget: "string"}
- {label: "Link Type Post (leave empty for normal posts)", name: "link", widget: "string", required: false}
- {label: "Author(s)", name: "authors", widget: "relation", collection: "authors", multiple: true, searchFields: ["title"], valueField: "title", display_fields: ["name"], required: false}
- {label: "Body", name: "body", widget: "markdown"}
- {label: "Categories", name: "categories", widget: "select", options: ["association", "network"], required: false}
- {label: "Tags", name: "tags", widget: "list", required: false}
Expand Down Expand Up @@ -105,6 +106,23 @@ collections: # A list of collections the CMS should be able to edit
- {label: "Image", name: "image", widget: "image", required: false}
- {label: "Thumbnail for Partner Overview", name: "teaser", widget: "image", required: false}
- {label: "Label (e.g. for credit)", name: "credit", widget: "string", required: false}
- name: "authors"
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to wrap this in an "{% if site.cms.has_members %}{% raw %}

//your code

{% endraw %}

Copy link
Author

Choose a reason for hiding this comment

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

Shouldn't this be always enabled? Otherwise the link inside the "posts" collection can be broken

label: "Authors"
folder: "_authors/"
slug: "{{title}}"
create: true
editor:
preview: false
fields:
- {label: "Title", name: "title", widget: "string"}
- {label: "Display Name", name: "name", widget: "string"}
- {label: "Home page", name: "home", widget: "string", required: false}
- {label: "Mail", name: "mail", widget: "string", required: false}
- {label: "Twitter handle (without at)", name: "twitter", widget: "string", required: false}
- {label: "Linkedin handle", name: "linkedin", widget: "string", required: false}
- {label: "Instagram handle", name: "instagram", widget: "string", required: false}
- {label: "Facebook page", name: "facebook", widget: "string", required: false}
- {label: "Biography", name: "bio", widget: "markdown", required: false}
{% endraw %}{% if site.cms.has_members %}{% raw %}
- name: "member"
label: "Members"
Expand Down