Skip to content

Commit 2161d54

Browse files
committed
Add letter template
1 parent db46b48 commit 2161d54

7 files changed

Lines changed: 108 additions & 25 deletions

File tree

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { remarkHeadingId } from "remark-custom-heading-id";
44
import rehypeSlug from 'rehype-slug';
55
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
66
import rehypeExternalLinks from "rehype-external-links";
7+
import yaml from '@rollup/plugin-yaml';
78

89
export default defineConfig({
910
site: 'https://keepandroidopen.org',
@@ -14,6 +15,9 @@ export default defineConfig({
1415
prefixDefaultLocale: false,
1516
},
1617
},
18+
vite: {
19+
plugins: [yaml()]
20+
},
1721
markdown: {
1822
remarkPlugins: [remarkHeadingId, remarkKramdownClasses],
1923
rehypePlugins: [[rehypeExternalLinks, {

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"rehype-external-links": "^3.0.0",
1515
"rehype-slug": "^6.0.0",
1616
"remark-custom-heading-id": "^2.0.0"
17+
},
18+
"devDependencies": {
19+
"@rollup/plugin-yaml": "^4.1.2"
1720
}
1821
}

src/content/pages/en/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ site_privacy: "**Privacy:** This site uses no cookies and performs no user track
1313
site_copyright: "**Copyright:** None. This work is marked"
1414

1515
lockdown_banner: "Android will become a locked-down platform"
16+
open_letter_header: "Open Letter"
17+
open_letter_description: "An open letter to advocate for Android as a free, open platform."
1618
---
1719

1820
In August 2025, Google [announced](https://developer.android.com/developer-verification) that as of September 2026,

src/data/signatures.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: John Doe
2+
title: Software Engineer
3+
organization: Example Corp
4+
- name: Jane Smith
5+
title: Community Organizer
6+
organization: Advocacy Group

src/layouts/Default.astro

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface Props {
1414
site_privacy: string;
1515
site_copyright: string;
1616
lockdown_banner: string;
17+
open_letter_header: string;
18+
open_letter_description: string;
1719
}
1820
1921
const {
@@ -28,6 +30,8 @@ const {
2830
site_privacy,
2931
site_copyright,
3032
lockdown_banner,
33+
open_letter_header,
34+
open_letter_description,
3135
} = Astro.props;
3236
3337
const languageEntries = Object.entries(languages);
@@ -51,17 +55,14 @@ const languageEntries = Object.entries(languages);
5155
<meta name="twitter:image" content="https://keepandroidopen.org/img/altered-deal.png">
5256
<link rel="me" href="https://techhub.social/@keepandroidopen">
5357
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
54-
55-
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.colors.min.css"> -->
5658
<style is:global>
57-
5859
main {
5960
max-width: 1200px;
6061
margin-left: auto;
6162
margin-right: auto;
6263
padding: 2em;
6364
}
64-
65+
6566
h1 {
6667
/* font-size: 46px; */
6768
/* font-weight: 600; */
@@ -199,7 +200,7 @@ const languageEntries = Object.entries(languages);
199200
padding: 1rem 2rem; */
200201
background: linear-gradient(180deg, #d32f2f 0%, #b71c1c 100%);
201202
border-bottom: 4px solid #801313;
202-
203+
203204
/* Text Styling */
204205
color: #ffffff;
205206
font-family: 'Arial Black', sans-serif;
@@ -208,7 +209,7 @@ const languageEntries = Object.entries(languages);
208209
letter-spacing: 2px;
209210
font-size: 1.5rem;
210211
text-align: center;
211-
212+
212213
/* The 3D Depth & Shadow Effect */
213214
/* Format: x-offset y-offset blur color */
214215
text-shadow:
@@ -217,17 +218,17 @@ const languageEntries = Object.entries(languages);
217218
0px 3px 0px #751111,
218219
0px 4px 0px #5e0d0d,
219220
0px 6px 10px rgba(0, 0, 0, 0.5);
220-
221+
221222
/* Animation to draw attention */
222223
animation: pulse-alert 2s infinite;
223-
224+
224225
@keyframes pulse-alert {
225226
0% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7); }
226227
70% { box-shadow: 0 0 0 15px rgba(211, 47, 47, 0); }
227228
100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0); }
228229
}
229-
230-
}
230+
231+
}
231232
</style>
232233
</head>
233234
<body>
@@ -254,11 +255,9 @@ const languageEntries = Object.entries(languages);
254255
<h4 style="margin-top: 0; margin-bottom: 10px; font-size: 16px;">
255256
{contact_header}
256257
</h4>
257-
<ul style="list-style: none; padding: 0; margin: 0;">
258-
<li style="margin-bottom: 5px;">{contact_email}: <a href="mailto:info@keepandroidopen.org" style="text-decoration: none;">info@keepandroidopen.org</a></li>
259-
</ul>
260-
<ul style="list-style: none; padding: 0; margin: 0;">
261-
<li style="margin-bottom: 5px;">{site_problems_header}: <a href="https://github.com/keepandroidopen/keepandroidopen.github.io/issues" style="text-decoration: none;">{site_report_issues}</a></li>
258+
<ul style="padding: 0; margin: 0;">
259+
<li style="list-style: none; margin-bottom: 5px;">{contact_email}: <a href="mailto:info@keepandroidopen.org" style="text-decoration: none;">info@keepandroidopen.org</a></li>
260+
<li style="list-style: none; margin-bottom: 5px;">{site_problems_header}: <a href="https://github.com/keepandroidopen/keepandroidopen.github.io/issues" style="text-decoration: none;">{site_report_issues}</a></li>
262261
</ul>
263262
</div>
264263
<div style="flex: 3; min-width: 300px; margin: 20px;">
@@ -317,42 +316,42 @@ const languageEntries = Object.entries(languages);
317316

318317
return `${trimConjunction ? "" : prefix}${segments}`;
319318
}
320-
319+
321320
// Set the date we're counting down to
322321
var countDownDate = new Date("Sep 1, 2026 00:00:00").getTime();
323322

324323
function updateBanner() {
325324
// Get today's date and time
326325
var now = new Date().getTime();
327-
326+
328327
// Find the distance between now and the count down date
329328
var distance = countDownDate - now;
330-
329+
331330
// Time calculations for days, hours, minutes and seconds
332331
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
333332
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
334333
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
335334
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
336-
335+
337336
const locale = document.documentElement.lang; // navigator.language; // Detects browser language (e.g., 'en-US');
338-
337+
339338
var remaining = [
340339
days > 0 ? getLocalizedUnit(days, 'day', locale, false) : '',
341-
hours > 0 ? getLocalizedUnit(hours, 'hour', locale, true) : '',
342-
minutes > 0 ? getLocalizedUnit(minutes, 'minute', locale, true) : '',
340+
hours > 0 || days > 0 ? getLocalizedUnit(hours, 'hour', locale, true) : '',
341+
minutes > 0 || hours > 0 || days > 0 ? getLocalizedUnit(minutes, 'minute', locale, true) : '',
343342
getLocalizedUnit(seconds, 'second', locale, true)
344343
].filter(Boolean).join(' ');
345-
344+
346345
// Display the result in the element with id="countdown"
347346
document.getElementById("countdown").innerHTML = remaining;
348-
347+
349348
// // If the count down is finished, write some text
350349
// if (distance < 0) {
351350
// clearInterval(x);
352351
// document.getElementById("countdown").innerHTML = "EXPIRED";
353352
// }
354353
}
355-
354+
356355
// Update the count down every 1 second
357356
setInterval(updateBanner, 1000);
358357
updateBanner();

src/pages/letter.astro

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
import Default from "../layouts/Default.astro";
3+
import { getCollection } from "astro:content";
4+
5+
const page = (await getCollection("pages", ({ id }) => id.startsWith("en/")))[0];
6+
---
7+
8+
<Default {...page.data}>
9+
<article class="prose dark:prose-invert">
10+
<h1>Open Letter</h1>
11+
<p>Dear recipient,</p>
12+
<p>This is a template for an open letter.</p>
13+
<p>Sincerely,</p>
14+
<div class="signatures-block">
15+
<h2>Signatures</h2>
16+
<ul id="signatures-list"></ul>
17+
</div>
18+
</article>
19+
</Default>
20+
21+
<script>
22+
import signatures from "../data/signatures.yaml";
23+
24+
const signaturesList = document.getElementById("signatures-list");
25+
26+
signatures.forEach(signature => {
27+
const listItem = document.createElement("li");
28+
listItem.innerHTML = `
29+
<strong>${signature.name}</strong><br>
30+
${signature.title}, ${signature.organization}
31+
`;
32+
signaturesList.appendChild(listItem);
33+
});
34+
</script>

0 commit comments

Comments
 (0)