Skip to content

Blog: one-line summaries for the feed, meta description and Discord mirror - #191

Merged
bong-water-water-bong merged 1 commit into
mainfrom
blog-summaries
Sep 28, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
blog-summaries

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Adds an optional summary: line to blog posts (next to tags:). tools/site.py uses it as the meta description, the JSON-LD description and the feed.xml <summary> (the Discord blog mirror posts that). The blog index keeps the lead paragraph. All 13 posts get a summary of at most 160 characters with the post's headline number, taken from the post itself. Site built locally (38 pages); the line does not show on the pages.

🤖 Generated with Claude Code

…on and Discord mirror

A post may carry "summary: one line" next to its tags. tools/site.py uses it as the page's meta
description, the JSON-LD description and the feed.xml <summary>, which the Discord blog mirror
posts; the blog index keeps the lead paragraph. All 13 posts get one, each <= 160 characters
with the post's headline number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@context7

context7 Bot commented Sep 28, 2026

Copy link
Copy Markdown

Docs7 for 1bit-monster/engine

Result Status Action
Deployment ➖ Not used —
Content review ➖ Did not run. This site has no agent runs available this month. Wait for the monthly reset or check your Docs7 plan. —

Commit 22d46d0

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Summary Length Validation

The PR introduces a new summary: field for blog posts, which is used as the meta description and feed summary. However, there is no validation or enforcement of the 160-character limit mentioned in the PR description. If a summary exceeds this limit, it could lead to issues with feed validation or meta description length restrictions in browsers and social platforms.

"""-> (tags, title, lead paragraph, the rest, one-line summary or "") of a post."""
text = strip_notice(text)
tags, summary = [], ""
while True:
    m = re.match(r"\s*(tags|summary):\s*(.+)\n", text)
    if not m:
        break
    if m.group(1) == "tags":
        tags += [t.strip() for t in m.group(2).split(",") if t.strip()]
    else:
        summary = m.group(2).strip()
    text = text[m.end():]
m = re.match(r"\s*# (.+)\n", text)
if not m:
    sys.exit("a post starts with its '# Title'")
rest = text[m.end():].strip()
lead, _, body = rest.partition("\n\n")
return tags, re.sub(r"[`*]", "", m.group(1)).strip(), lead.strip(), body, summary
Potential HTML Injection in Summary

The summary field is directly inserted into HTML attributes and feed XML without proper escaping in some contexts. While html.escape is used in write and feed.xml, the summary is not escaped when used in the JSON-LD description field, which could lead to potential HTML injection if the summary contains unescaped characters.

"description": summary, "datePublished": date,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant