Skip to content

Homepage announcements: cap at 3, per-post opt-out - #127

Merged
alphdelta merged 2 commits into
mainfrom
devin/1787345300-announcement-flag
Aug 21, 2026
Merged

Homepage announcements: cap at 3, per-post opt-out#127
alphdelta merged 2 commits into
mainfrom
devin/1787345300-announcement-flag

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Homepage announcements are now driven per news post instead of by a fixed slice: every news post appears by default, and the homepage renders the 3 most recent visible ones (a hidden post is skipped over, not counted against the cap).

Opt a post out in its frontmatter:

+++
title = ""

[extra]
announcement = false
+++

Template logic (templates/index.html):

{% set_global announcements_shown = 0 %}
{% for news_post in news_section.pages %}
{% if announcements_shown < 3 and news_post.extra.announcement | default(value=true) %}
  … card …
  {% set_global announcements_shown = announcements_shown + 1 %}
{% endif %}
{% endfor %}

All existing news posts except the newest ("BMT 2026 will be held on November 14, 2026") are flagged announcement = false, so the homepage currently shows exactly one card. New posts need no frontmatter change to appear.

Link to Devin session: https://app.devin.ai/sessions/b2cad97fe85e4ad7aa2ed105e43fc39b
Requested by: @alphdelta

…-out

Co-Authored-By: golden <golden@berkeley.mt>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: golden <golden@berkeley.mt>
@alphdelta
alphdelta merged commit a9b23bc into main Aug 21, 2026
3 checks passed
@alphdelta
alphdelta deleted the devin/1787345300-announcement-flag branch August 21, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant