This repository has been archived on 2026-01-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
hackernews-lambda-on-aws/assets/hackernews_template.gohtml
2022-09-09 16:58:43 +02:00

43 lines
2.2 KiB
Plaintext

<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Newsletter</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
</head>
<body style="font-family: Montserrat, sans-serif; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; min-height: 100%; background: #fff;">
<h1>Today's Newsletter</h1>
<div style="margin: 5% auto; max-width: 95%;">
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;">
{{ range .News }}
<div style="background: #fff; border-radius: 0.5rem; padding: 1.5rem 1rem; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2), -4px 0 4px rgba(0, 0, 0, 0.2);" data-article-id="">
<h2 style="font-size: 1.5rem; margin-bottom: 1rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;" data-article-title="">
{{ .Title }}
</h2>
<small style="font-size: 0.8rem; opacity: 0.7;" data-article-time="">Unix Epoch {{ .CreatedAt }}</small>
<div style="font-size: 1.125rem; margin: 1rem 0; line-height: 1.5rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;" data-article-text="">
{{ .Text }}
</div>
<div style="display: flex; justify-content: space-between; align-items: center;">
<h3 style="font-size: 1rem; font-weight: 500;" data-article-by="">written by: {{ .Author }}</h3>
<a
style="text-decoration: none; font-size: 1rem; font-weight: 600; color: rgb(35, 35, 163);"
data-article-url-=""
href="{{ .Url }}"
target="_blank"
>Read more</a
>
</div>
</div>
{{ end }}
</div>
</div>
</body>
</html>