Skip to content

Commit

Permalink
Remember to add the new footer property to the front matter schema
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwlchan committed Oct 16, 2024
1 parent 9ee4180 commit 544ede9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion front-matter.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@
},
"additionalProperties": false
},
"footer": {
"type": "object",
"properties": {
"hide_newsletter": {
"description": "Whether to hide the newsletter subscribe from in the footer",
"type": "boolean"
}
},
"additionalProperties": false
},
"meta": {
"description": "Used on pages for miscellaneous information. Deprecated; should be replaced by purpose-named fields.",
"type": "array",
Expand All @@ -87,7 +97,7 @@
"nav_section": {
"description": "Which section of the site this page/post belongs to.",
"type": "string",
"enum": ["articles", "til", "contact"]
"enum": ["articles", "til", "contact", "subscribe"]
},
"card_image": {
"description": "Complete path to an image that should be used in link previews on social media, e.g. Twitter cards or OpenGraph metadata.",
Expand Down
4 changes: 2 additions & 2 deletions src/_includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
</p>
</div>

{% if page.footer.exclude_newsletter %}
{% if page.footer.hide_newsletter %}
<style>
#footer_inner {
grid-template-columns: auto;
}
</style>
{% endif %}

{% unless page.footer.exclude_newsletter %}
{% unless page.footer.hide_newsletter %}
<form
action="https://buttondown.com/api/emails/embed-subscribe/alexwlchan"
method="post"
Expand Down
2 changes: 1 addition & 1 deletion src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ colors:
css_light: "#17823e"
css_dark: "#26d967"
footer:
exclude_newsletter: true
hide_newsletter: true
---

<style type="x-text/scss">
Expand Down
2 changes: 1 addition & 1 deletion src/subscribe.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: Subscribe!
nav_section: subscribe
footer:
exclude_newsletter: true
hide_newsletter: true
---
{% include newsletter.html %}

Expand Down

0 comments on commit 544ede9

Please sign in to comment.