Skip to content

Commit 2b2d971

Browse files
alexwolsonclaude
andauthored
Refactor excerpt and description handling for consistency (#76)
- 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>
1 parent 0f38e51 commit 2b2d971

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ github_username: civictechto
1313

1414
timezone: America/Toronto
1515
future: true
16+
page_excerpts: true
1617

1718
include:
1819
- _pages

_includes/jsonld.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@
7171
"url": {{ page.url | absolute_url | jsonify }}
7272

7373
{% elsif page_tags contains "type/meetup" %}
74+
{% assign meetup_description = page.description | default: page.content | strip_html | strip_newlines | truncatewords: 50 %}
7475
"@type": "Event",
7576
"name": {{ page.title | jsonify }},
7677
"startDate": "{{ page.date }}",
7778
"endDate": "{{ page.date }}",
78-
"description": {{ page.description | strip_html | strip_newlines | jsonify }},
79+
"description": {{ meetup_description | jsonify }},
7980
{% if page.venue %}
8081
"location": {
8182
"@type": "Place",

_layouts/project.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ <h1>{{ page.title }}</h1>
4545
<div class="main-with-sidebar">
4646
<div class="main-content">
4747
<section class="project-description">
48-
{% if page.description %}
49-
<p>{{ page.description }}</p>
50-
{% endif %}
5148
{{ content }}
5249
</section>
5350
</div>

_layouts/resource.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@
1414
<header>
1515
<hgroup>
1616
<h1>{{ page.title }}</h1>
17-
{% if page.excerpt %}
18-
<p>{{ page.excerpt }}</p>
17+
{% if page.description %}
18+
<p>{{ page.description }}</p>
1919
{% endif %}
2020
</hgroup>
2121
</header>
2222

2323
<section class="resource-details">
24-
{% if page.description %}
25-
<p>{{ page.description }}</p>
26-
{% endif %}
2724

2825
{% if page.website %}
2926
<p>

0 commit comments

Comments
 (0)