Skip to content

Refactor excerpt and description handling for consistency#76

Merged
jordyarms merged 1 commit intomainfrom
fix/excerpt-description-handling
Feb 24, 2026
Merged

Refactor excerpt and description handling for consistency#76
jordyarms merged 1 commit intomainfrom
fix/excerpt-description-handling

Conversation

@alexwolson
Copy link
Collaborator

Summary

Fixes inconsistent use of excerpt and description fields across layouts and JSON-LD. Two fields serve distinct roles:

  • excerpt — short tagline, shown in <hgroup> subtitle and card listings
  • description — longer body copy, shown in main content area

Changes

  • _config.yml: Add page_excerpts: true so Jekyll 4.1.1+ auto-generates page.excerpt for pages (not just posts), enabling the subtitle in page.html to render without requiring manual front matter
  • _layouts/resource.html: Move description from body section to <hgroup> subtitle — resources use description in front matter (not excerpt), so the old header check was always dead; description is a one-liner that belongs in the subtitle position
  • _layouts/project.html: Remove dead {% if page.description %} body block — projects use excerpt (already shown in the header); description was almost never set in project front matter
  • _includes/jsonld.html: Fix meetup Event Schema.org description — was always outputting an empty string because meetups have no description front matter field; now falls back to page body content (stripped, truncated to 50 words)

Test plan

  • Resource detail page shows description as subtitle beneath title
  • Project detail page renders correctly (no regression)
  • View source on a meetup page — JSON-LD description field is now populated
  • Pages with excerpt in front matter still render subtitle correctly

Closes #63

- Enable page_excerpts in _config.yml so Jekyll auto-generates
  page.excerpt for pages (not just posts)
- resource.html: move description from body to header hgroup subtitle;
  resources use description in front matter, not excerpt, so the old
  header check was dead code
- project.html: remove dead {% if page.description %} body block;
  projects use excerpt (shown in header), description was never set
- jsonld.html: fix meetup Event description, which was always empty
  since meetups have no description front matter field; fall back to
  page content stripped and truncated to 50 words

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@jordyarms jordyarms left a comment

Choose a reason for hiding this comment

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

OK! lgtm

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.

Refactoring of excerpt and description handling

2 participants