Skip to content

Add pins to main site - #635

Open
dschrempf wants to merge 4 commits into
haskellfoundation:hakyllfrom
dschrempf:dom/pins
Open

Add pins to main site#635
dschrempf wants to merge 4 commits into
haskellfoundation:hakyllfrom
dschrempf:dom/pins

Conversation

@dschrempf

@dschrempf dschrempf commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

This PR introduces featured articles (i.e., pins).

In detail,

  • Retire the Head of Development announcement (redirect to job ad)
  • Give the home page curated pins and separate bands
  • Derive event dates from front matter instead of a status field
  • Factor out nonEmpty for list fields

For details, see the commit messages.

I think the next step is to reduce white space of the tiles. I will wait until this PR has been discussed and merged before going on.


Checklist

@dschrempf
dschrempf marked this pull request as ready for review August 28, 2026 08:30
@dschrempf

Copy link
Copy Markdown
Collaborator Author

Pictures say more than words :-) (I had to zoom out):
image

A listField over an empty list still counts as present, so `$if(...)$` is
True and a template renders a section heading above no tiles. Both places
that worked around this required the same guard.

No change in output.
Events carried a prose `daterange` and a hand-maintained `status`, and the home
page showed every event marked active. Nobody flips that field once an event is
over, so five of seven events still claimed to be active and four of those had
already happened. Consequence: the "front page tiles are weird choices" bias
towards events (haskellfoundation#632).

Replace both with `starts:` and, for a multi-day event, `ends:` as ISO
dates. `EventDates` parses them, `formatDateRange` words the range the
templates print, and the home page keeps only events that have not finished
yet. The events index sorts by start date rather than announcement date.

The cutoff is the build date, so a finished event lingers until the next
push to hakyll.
The front page put open job ad, one news entry, one podcast episode and every
active event into a single grid, so events crowded out everything else and there
was no way to put anything specific on top. See issues "manually curated links
at top" (haskellfoundation#624) and "the front page tiles are weird choices":(haskellfoundation#632).

Split the grid into four bands, each hidden when it has nothing to show:
the curated pins, the latest news, the events still to come, and the latest
podcast episode. News goes from one entry to two, and the news and events
bands link on to their index pages.

Pins come from featured.markdown, an ordered list of paths of pages that exist
elsewhere in the site. A pin is a pointer, never a second copy of the text. The
tile shows the page's title, its summary (or its first paragraph) and a link to
it. That is, news entries, job openings and events can all be pinned. A path
naming no page fails the build. Anything pinned is dropped from the automatic
bands below.

This replaces the hard-wired band of open job ads: the front page is curated
now, and a new opening is pinned by hand.
Its whole body was a pointer to the job ad, which the home page now pins
directly, so the entry only stood between a reader and the thing they came
for.

Redirect its URL to the ad rather than dropping it: the announcement has
been linked to from elsewhere. `retiredPages` feeds Hakyll's
`createRedirects`, which writes a meta-refresh and rel=canonical stub at
the old path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Having this be a news item is nice because it signifies a change. If we just added a job posting, I'm not sure it would get the same amount of attention

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nevermind, I see it can be "featured"

Comment thread site.hs
Comment on lines +76 to +80
retiredPages :: [(Identifier, String)]
retiredPages =
-- Was an announcement whose only content was a pointer to the job ad; the
-- ad is now pinned on the home page directly (see 'featuredCuration').
[("news/2026-08-10/head-of-development.html", "/careers/head-of-development.html")]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to prevent this added complexity, we might as well add the head-of-development news item back in

@LaurentRDC LaurentRDC linked an issue Aug 28, 2026 that may be closed by this pull request
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.

The front page tiles are weird choices

2 participants