Skip to content

Commit

Permalink
Added new fields to Netlify CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagorossener committed Feb 4, 2020
1 parent c1f39cc commit ce8cb00
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ tags:
email: youremail@xyz.com
disqus_username: disqus_username
show_hero: true
paginate: 0
categories_folder: category
sent_message_url: "/contact/message-sent/"
menu:
Expand Down
2 changes: 1 addition & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h1 class="title">{{ featured.title }}</h1>
{% for post in posts offset: offset %}
<article class="box-item">
<span class="category">
<a href="{{ site.baseurl }}/{{ site.categories_folder }}/{{ post.category }}">
<a href="{{ site.baseurl }}/{{ site.categories_folder | default: 'category' }}/{{ post.category }}">
<span>{{ post.category }}</span>
</a>
</span>
Expand Down
22 changes: 22 additions & 0 deletions admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,19 @@ collections:
name: "show_hero"
widget: "boolean"
default: true
- label: "Menu"
name: "menu"
widget: "list"
required: false
fields:
- label: "Title"
name: "title"
widget: "string"
hint: "Text that will show up in the menu"
- label: "URL"
name: "url"
widget: "string"
hint: "Ex: /contact"
- label: "E-mail"
name: "email"
widget: "string"
Expand All @@ -229,6 +242,15 @@ collections:
valueType: "int"
required: false
hint: "Leave it blank if you don't want pagination"
- label: "Categories folder"
name: "categories_folder"
widget: "string"
hint: "Folder where all the categories pages are. Ex: category"
required: false
- label: "Contact Feedback URL"
name: "sent_message_url"
hint: "URL where the user will be redirected for after submit the contact form. Ex: /contact/message-sent/"
required: false
- label: "Social"
name: "social"
file: "src/yml/social.yml"
Expand Down
1 change: 1 addition & 0 deletions src/yml/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tags:
email: youremail@xyz.com
disqus_username: disqus_username
show_hero: true
paginate: 0
categories_folder: category
sent_message_url: "/contact/message-sent/"
menu:
Expand Down

0 comments on commit ce8cb00

Please sign in to comment.