themes-brutalist/email_wrapper.templ
Alex Dunmow 771a286fa9 initial: theme plugin brutalist
Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously
an unversioned directory inside ~/src/blockninja-themes/brutalist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-06 14:11:21 +08:00

66 lines
2.8 KiB
Plaintext

package main
import "git.dev.alexdunmow.com/block/core/templates"
templ brutalistEmailTemplate(emailCtx templates.EmailContext, body string) {
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="x-apple-disable-message-reformatting"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<title>{ emailCtx.SiteSettings.SiteName }</title>
<style type="text/css">
body, table, td, p, a, li, blockquote { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { -ms-interpolation-mode: bicubic; border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
body { margin: 0 !important; padding: 0 !important; width: 100% !important; }
@media only screen and (max-width: 620px) {
.brutalist-email-container { width: 100% !important; max-width: 100% !important; }
.brutalist-email-pad { padding-left: 24px !important; padding-right: 24px !important; }
}
</style>
</head>
<body style={ brutalistEmailBodyStyle(emailCtx) }>
if emailCtx.PreviewText != "" {
<div style="display: none; max-height: 0; overflow: hidden; mso-hide: all;">{ emailCtx.PreviewText }</div>
}
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" style={ brutalistEmailOuterCellStyle(emailCtx) }>
<table role="presentation" class="brutalist-email-container" width="600" cellspacing="0" cellpadding="0" border="0" style={ brutalistEmailContainerStyle(emailCtx) }>
<tr>
<td align="left" class="brutalist-email-pad" style={ brutalistEmailHeaderStyle(emailCtx) }>
if emailCtx.SiteSettings.SiteName != "" {
<h1 style={ brutalistEmailHeadlineStyle(emailCtx) }>{ emailCtx.SiteSettings.SiteName }</h1>
}
</td>
</tr>
<tr>
<td class="brutalist-email-pad" style={ brutalistEmailBodyCellStyle(emailCtx) }>
@templ.Raw(body)
</td>
</tr>
<tr>
<td class="brutalist-email-pad" style={ brutalistEmailFooterStyle(emailCtx) }>
if emailCtx.SiteSettings.SiteURL != "" {
<div style="margin-bottom: 8px;">
<a href={ templ.SafeURL(emailCtx.SiteSettings.SiteURL) } style={ brutalistEmailLinkStyle(emailCtx) }>{ emailCtx.SiteSettings.SiteURL }</a>
</div>
}
if emailCtx.UnsubscribeURL != "" {
<div>
<a href={ templ.SafeURL(emailCtx.UnsubscribeURL) } style={ brutalistEmailLinkStyle(emailCtx) }>UNSUBSCRIBE</a>
</div>
}
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
}