Skip to content

Commit 4eb2d2c

Browse files
committed
test draft with new email stuff
1 parent a21c137 commit 4eb2d2c

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/send-email.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ jobs:
151151
152152
# Extract title (handle both quoted and unquoted)
153153
TITLE=$(echo "$FRONTMATTER" | grep "^title\s*=" | head -n 1 | sed 's/^title\s*=\s*//' | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
154+
DESCRIPTION=$(echo "$FRONTMATTER" | grep "^description\s*=" | head -n 1 | sed 's/^description\s*=\s*//' | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
154155
POST_SLUG=$(basename "$file" .md)
155156
POST_URL="https://viruus.zip/$POST_SLUG/"
156157
POST_DATE=$(echo "$FRONTMATTER" | grep "^date\s*=" | head -n 1 | sed 's/^date\s*=\s*//' | sed 's/^"\(.*\)"$/\1/' | sed "s/^'\(.*\)'$/\1/")
@@ -184,6 +185,10 @@ jobs:
184185
# Fix relative image paths to absolute URLs
185186
POST_HTML=$(echo "$POST_HTML" | sed 's|src="/images/|src="https://viruus.zip/images/|g')
186187
188+
# Inline CSS classes (email clients don't support external CSS)
189+
# Convert class="half-width" to inline style
190+
POST_HTML=$(echo "$POST_HTML" | sed 's|class="half-width"|style="width: 50%;"|g')
191+
187192
# Remove footnote anchor links (email clients don't handle anchors well)
188193
# Use perl with -0777 flag to handle multiline HTML properly
189194
@@ -203,11 +208,16 @@ jobs:
203208
POST_HTML=$(echo "$POST_HTML" | perl -pe 's| role="doc-backlink"||g')
204209
POST_HTML=$(echo "$POST_HTML" | perl -pe 's| role="doc-endnotes"||g')
205210
206-
# Add simple header (date + canonical link), separator, and unsubscribe footer
211+
# Add preheader (hidden text for email preview), header, separator, and unsubscribe footer
212+
# Preheader is hidden but email clients use it as preview text
213+
PREHEADER_HTML=""
214+
if [ -n "$DESCRIPTION" ]; then
215+
PREHEADER_HTML="<div style=\"display:none;font-size:1px;line-height:1px;max-height:0px;max-width:0px;opacity:0;overflow:hidden;\">$DESCRIPTION</div>"
216+
fi
207217
HEADER_HTML="<p><time datetime=\"$POST_DATE_ISO\">$POST_DATE_DISPLAY</time> - <a href=\"$POST_URL\">Read on my website</a></p>"
208218
SEPARATOR_HTML="<hr />"
209219
UNSUBSCRIBE_HTML="<p>If you no longer want these emails, <a href=\"{{{RESEND_UNSUBSCRIBE_URL}}}\">unsubscribe</a>.</p>"
210-
POST_HTML="${HEADER_HTML}${POST_HTML}${SEPARATOR_HTML}${UNSUBSCRIBE_HTML}"
220+
POST_HTML="${PREHEADER_HTML}${HEADER_HTML}${POST_HTML}${SEPARATOR_HTML}${UNSUBSCRIBE_HTML}"
211221
212222
# Escape content for JSON
213223
POST_HTML_ESCAPED=$(echo "$POST_HTML" | jq -Rs .)

content/blog/feedback-loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
+++
22
title = "I'm Sorry Dave, I'm Afraid I Can't See That"
33
slug = "feedback-loops"
4-
date = "2026-01-21T09:59:37-08:00"
4+
date = "2026-01-21T12:11:47-08:00"
55
description = "A look at why vibe-coding in the traditional sense doesn't work, and a (known) solution to it."
66
draft = "true"
77
tags = ["amp","email","programming","web","ai","claude","feedbackloop"]

0 commit comments

Comments
 (0)