Skip to content

Commit

Permalink
makes links in footer configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskundig committed Jun 30, 2021
1 parent e9d188d commit 15302cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
14 changes: 12 additions & 2 deletions conf/netlify/cms/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,20 @@ collections:
file: src/site/_data/links.json
i18n: false
fields:
- { label: Twitter label, name: twitter_label, required: true, widget: string }
- { label: Twitter label, name: twitter_label, required: false, widget: string,
hint: "If this field is empty, the link to twitter will not appear in the website's footer" }
- { label: Twitter URL, name: twitter_url, required: true, widget: string }
- { label: Forum label, name: forum_label, required: true, widget: string }
- { label: Forum label, name: forum_label, required: false, widget: string ,
hint: "If this field is empty, the link to the forum will not appear in the website's footer" }
- { label: Forum URL, name: forum_url, required: true, widget: string }
- label: "Additional links"
name: "additional_links"
widget: "list"
summary: '{{fields.name}}'
fields:
- {label: Name, name: name, widget: string }
- {label: Link, name: url, widget: file}

- label: Home page
name: home
# Configure i18n for this collection.
Expand Down
11 changes: 9 additions & 2 deletions src/site/_includes/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@
{% ilink page, "contact/info", locale %}{{i18n.header_footer[locale].contact}}{% endilink %}
</nav>
<nav class="footer-navigation">
<a href="{{links.twitter_url}}" rel="nofollow noopener">{{links.twitter_label}}</a>
<a href="{{links.forum_url}}" rel="nofollow noopener">{{links.forum_label}}</a>
{% if links.forum_url %}
<a href="{{links.twitter_url}}" rel="nofollow noopener">{{links.twitter_label}}</a>
{% endif %}
{% if links.forum_url %}
<a href="{{links.forum_url}}" rel="nofollow noopener">{{links.forum_label}}</a>
{% endif %}
{% for link in links.additional_links %}
<a href="{{link.url}}" rel="nofollow noopener">{{link.name}}</a>
{% endfor %}
</nav>
</div>
</div>
Expand Down

0 comments on commit 15302cc

Please sign in to comment.