Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
# Glide website

The website for Glide, the scrolling window manager for [Mac](https://github.com/QuackByte/glide) and [Windows](https://github.com/QuackByte/glide-windows). Built with Astro 7 (Vite under the hood) and TypeScript, in English and Spanish, and served at **https://quackbyte.dev/glide/**.
The website for Glide, the scrolling window manager for [Mac](https://github.com/QuackByte/glide) and [Windows](https://github.com/QuackByte/glide-windows). Built with Astro 7 (Vite under the hood) and TypeScript, in eight languages, and served at **https://quackbyte.dev/glide/**.

| Page | English | Español |
| Language | Home | Privacy policy |
| --- | --- | --- |
| Home, downloads, Mac & Windows table | `/glide/` | `/glide/es/` |
| Privacy policy | `/glide/privacy/` | `/glide/es/privacidad/` |
| English | `/glide/` | `/glide/privacy/` |
| Español | `/glide/es/` | `/glide/es/privacidad/` |
| Français | `/glide/fr/` | `/glide/fr/confidentialite/` |
| Deutsch | `/glide/de/` | `/glide/de/datenschutz/` |
| 日本語 | `/glide/ja/` | `/glide/ja/privacy/` |
| 简体中文 | `/glide/zh/` | `/glide/zh/privacy/` |
| 한국어 | `/glide/ko/` | `/glide/ko/privacy/` |
| Português (Brasil) | `/glide/pt/` | `/glide/pt/privacidade/` |

## Copy and translations

All visible copy lives in one file per language, [`src/i18n/<lang>.ts`](src/i18n). [`en.ts`](src/i18n/en.ts) defines the shape (its header explains how to translate, how `…Html` strings carry links and `<kbd>`, and the `{tokens}` such as `{mac}` that stand for URLs and key symbols); every other language is typed against it, so a missing key fails `npm run check`. Components never contain copy. Product names, URLs and key symbols come from [`src/config.ts`](src/config.ts) and `tokens()` in [`src/i18n.ts`](src/i18n.ts).

To change a sentence, edit it in every language file (or in English and let translators follow). To add a language: add a message file, then the language to `langs`, `languages` and `routes` in `src/i18n.ts`, to `i18n.locales` in `astro.config.mjs`, and a page pair under `src/pages/<lang>/`. CJK languages also need a font stack in `src/styles/global.css`.

## Downloads

The download buttons link to each app's latest GitHub release. In the browser, the page asks GitHub's API for that release and points them straight at the files (`*-macOS.zip`, `*-x64-Setup.exe`, `*-arm64-Setup.exe`), so a new release shows up without rebuilding the site. Keep those asset names in the apps' release workflows.

## Mac and Windows parity

[`src/data/features.ts`](src/data/features.ts) lists what each app does, and the home page renders it as the "Mac & Windows" table. It's the one place that tracks parity between the two apps:
[`src/data/features.ts`](src/data/features.ts) lists what each app does, and the home page renders it as the "Mac & Windows" table. It's the one place that tracks parity between the two apps. It holds feature ids and statuses; the names and notes are in the message files (`features.names` and `features.notes`, keyed by id):

- When a feature ships on one platform, add a row, `planned` on the other if it should follow.
- When a feature ships on one platform, add a row (plus its name in every `src/i18n/*.ts`), `planned` on the other if it should follow.
- When it ships on the other, flip it to `yes`.
- `partial` needs a note saying what differs; `na` is for things that don't apply to a platform.

Expand Down
6 changes: 5 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ export default defineConfig({
trailingSlash: 'always',
i18n: {
defaultLocale: 'en',
locales: ['en', 'es'],
locales: [
'en', 'es', 'fr', 'de', 'ja', 'ko',
{ path: 'zh', codes: ['zh-Hans'] },
{ path: 'pt', codes: ['pt-BR'] },
],
routing: { prefixDefaultLocale: false },
},
});
34 changes: 13 additions & 21 deletions src/components/Downloads.astro
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
---
import { repos, github, requirements } from '../config';
import type { Lang } from '../i18n';
import { repos, github } from '../config';
import { messages, filler, type Lang } from '../i18n';

interface Props { lang: Lang }
const { lang } = Astro.props;
const es = lang === 'es';
const t = messages[lang].downloads;
const fill = filler(lang);
const latest = (repo: string) => github(repo, '/releases/latest');
---
<div class="downloads" data-downloads>
<article class="download" data-platform="mac">
<h3>Mac</h3>
<p>{requirements.mac[lang]}. {es ? 'Firmada y notarizada por Apple.' : 'Signed and notarized by Apple.'}</p>
<p>{t.macNote}</p>
<p class="version" data-version hidden></p>
<div class="actions">
<a class="button" href={latest(repos.mac)} data-asset="-macOS.zip">{es ? 'Descargar para Mac' : 'Download for Mac'}</a>
<a class="button button--quiet" href={github(repos.mac)}>{es ? 'Código fuente' : 'Source code'}</a>
<a class="button" href={latest(repos.mac)} data-asset="-macOS.zip">{t.macButton}</a>
<a class="button button--quiet" href={github(repos.mac)}>{t.source}</a>
</div>
</article>
<article class="download" data-platform="windows">
<h3>Windows</h3>
<p>{requirements.windows[lang]}. {es ? 'Se instala sin permisos de administrador.' : 'Installs without administrator rights.'}</p>
<p>
{es
? 'Aún no está firmado con un certificado de código, así que Windows SmartScreen puede avisar la primera vez: elige Más información › Ejecutar de todas formas.'
: "Not code-signed yet, so Windows SmartScreen may warn the first time: choose More info › Run anyway."}
</p>
<p>{t.windowsNote}</p>
<p>{t.windowsWarning}</p>
<p class="version" data-version hidden></p>
<div class="actions">
<a class="button" href={latest(repos.windows)} data-asset="-x64-Setup.exe">{es ? 'Descargar (x64)' : 'Download (x64)'}</a>
<a class="button button--quiet" href={latest(repos.windows)} data-asset="-arm64-Setup.exe">{es ? 'Descargar (Arm)' : 'Download (Arm)'}</a>
<a class="button button--quiet" href={github(repos.windows)}>{es ? 'Código fuente' : 'Source code'}</a>
<a class="button" href={latest(repos.windows)} data-asset="-x64-Setup.exe">{t.windowsX64}</a>
<a class="button button--quiet" href={latest(repos.windows)} data-asset="-arm64-Setup.exe">{t.windowsArm}</a>
<a class="button button--quiet" href={github(repos.windows)}>{t.source}</a>
</div>
</article>
</div>
<p class="meta muted">
{es
? 'Las dos se actualizan solas. Cada versión, con sus notas y sumas de verificación, está en GitHub: '
: 'Both keep themselves up to date. Every release, with its notes and checksums, is on GitHub: '}
<a href={github(repos.mac, '/releases')}>Mac</a>, <a href={github(repos.windows, '/releases')}>Windows</a>.
</p>
<p class="meta muted" set:html={fill(t.releasesHtml)} />

<script>
// The buttons link to each repository's latest release page. Where GitHub answers, point them
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
import { owner, repos, github } from '../config';
import { href, ui, type Lang } from '../i18n';
import { href, messages, type Lang } from '../i18n';

interface Props { lang: Lang }
const { lang } = Astro.props;
const t = ui[lang].footer;
const t = messages[lang].footer;
const year = new Date().getFullYear();
---
<footer class="site-footer">
Expand Down
39 changes: 30 additions & 9 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
---
import { repos, github } from '../config';
import { href, asset, ui, type Lang, type Route } from '../i18n';
import { href, asset, messages, langs, languages, type Lang, type Route } from '../i18n';

interface Props { lang: Lang; route: Route }
const { lang, route } = Astro.props;
const other: Lang = lang === 'en' ? 'es' : 'en';
const t = ui[lang];
const t = messages[lang].header;
---
<header class="site-header">
<a class="brand" href={href('home', lang)}>
<img src={asset('app-icon.svg')} alt="" width="36" height="36" />
<span>Glide</span>
</a>
<nav aria-label={lang === 'es' ? 'Principal' : 'Main'}>
<a href={href('home', lang, '#download')}>{t.nav.download}</a>
<a href={href('home', lang, '#platforms')}>{t.nav.platforms}</a>
<a href={github(repos.mac)}>{t.nav.source}</a>
<a href={href(route, other)} hreflang={other} lang={other} aria-label={t.switchLabel}>{t.switchTo}</a>
</nav>
<div class="header-end">
<nav aria-label={t.mainNav}>
<a href={href('home', lang, '#download')}>{t.download}</a>
<a href={href('home', lang, '#platforms')}>{t.platforms}</a>
<a href={github(repos.mac)}>{t.source}</a>
</nav>
<details class="lang-switch">
<summary aria-label={`${t.language}: ${languages[lang].name}`}>
<svg class="lang-icon" viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false">
<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.8" />
<path d="M3 12h18M12 3c2.5 2.6 3.8 5.6 3.8 9s-1.3 6.4-3.8 9c-2.5-2.6-3.8-5.6-3.8-9S9.5 5.6 12 3z" fill="none" stroke="currentColor" stroke-width="1.8" />
</svg>
<span lang={languages[lang].htmlLang}>{languages[lang].name}</span>
</summary>
<ul>
{langs.map((l) => (
<li>
<a
href={href(route, l)}
hreflang={languages[l].htmlLang}
lang={languages[l].htmlLang}
aria-current={l === lang ? 'true' : undefined}
>{languages[l].name}</a>
</li>
))}
</ul>
</details>
</div>
</header>
29 changes: 11 additions & 18 deletions src/components/Parity.astro
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
---
import { groups, type Status } from '../data/features';
import type { Lang } from '../i18n';
import { groups, type NotedFeatureId } from '../data/features';
import { messages, filler, type Lang } from '../i18n';

interface Props { lang: Lang }
const { lang } = Astro.props;
const es = lang === 'es';
const labels: Record<Status, { en: string; es: string }> = {
yes: { en: 'Yes', es: 'Sí' },
partial: { en: 'Partly', es: 'En parte' },
planned: { en: 'Planned', es: 'Previsto' },
na: { en: 'Not needed', es: 'No aplica' },
};
const t = messages[lang];
const fill = filler(lang);
---
<div class="table-scroll">
<table class="parity">
<caption>
{es
? 'Glide para Mac y Glide para Windows comparten el mismo motor y los mismos atajos (⌃⌥ en Mac, Win en Windows). Esto es lo que hace cada una hoy.'
: 'Glide for Mac and Glide for Windows share one engine and the same shortcuts (⌃⌥ on Mac, Win on Windows). This is what each does today.'}
{fill(t.parity.caption)}
</caption>
<thead>
<tr><th scope="col">{es ? 'Función' : 'Feature'}</th><th scope="col">Mac</th><th scope="col">Windows</th></tr>
<tr><th scope="col">{t.parity.feature}</th><th scope="col">Mac</th><th scope="col">Windows</th></tr>
</thead>
{groups.map((group) => (
<tbody>
<tr><th scope="rowgroup" colspan="3">{group.name[lang]}</th></tr>
<tr><th scope="rowgroup" colspan="3">{t.features.groups[group.id]}</th></tr>
{group.features.map((f) => (
<tr>
<th scope="row">
{f.name[lang]}
{f.note && <span class="note">{f.note[lang]}</span>}
{t.features.names[f.id]}
{'note' in f && <span class="note">{t.features.notes[f.id as NotedFeatureId]}</span>}
</th>
<td><span class={`status status--${f.mac}`}>{labels[f.mac][lang]}</span></td>
<td><span class={`status status--${f.windows}`}>{labels[f.windows][lang]}</span></td>
<td><span class={`status status--${f.mac}`}>{t.parity.status[f.mac]}</span></td>
<td><span class={`status status--${f.windows}`}>{t.parity.status[f.windows]}</span></td>
</tr>
))}
</tbody>
Expand Down
10 changes: 4 additions & 6 deletions src/components/StripDemo.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
import type { Lang } from '../i18n';
import { messages, type Lang } from '../i18n';

interface Props { lang: Lang }
const { lang } = Astro.props;
const es = lang === 'es';
const t = messages[lang].strip;
// Column widths as a share of the screen: ⅓, ½, ⅔ and friends.
const columns = [
{ width: 34 }, { width: 50, focus: true }, { width: 26, stack: true }, { width: 40 }, { width: 34 }, { width: 50 },
];
---
<figure class="demo">
<div class="strip" role="img" aria-label={es
? 'Columnas de ventanas en una tira horizontal que se desliza bajo la pantalla'
: 'Columns of windows on a horizontal strip sliding under the screen'}>
<div class="strip" role="img" aria-label={t.label}>
<div class="strip-track">
{columns.map((c) => (
<div class:list={['strip-col', { 'strip-col--stack': c.stack, 'is-focus': c.focus }]} style={`width: ${c.width}%`}>
Expand All @@ -26,6 +24,6 @@ const columns = [
<figcaption class="strip-keys">
<span><kbd>⌃⌥←</kbd> <kbd>⌃⌥→</kbd> Mac</span>
<span><kbd>Win+←</kbd> <kbd>Win+→</kbd> Windows</span>
<span>{es ? 'o desliza tres dedos' : 'or swipe three fingers'}</span>
<span>{t.swipe}</span>
</figcaption>
</figure>
5 changes: 0 additions & 5 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ export const repos = {

export const github = (repo: string, path = '') => `https://github.com/${repo}${path}`;

export const requirements = {
mac: { en: 'macOS 27 or later, Apple silicon', es: 'macOS 27 o posterior, Apple silicon' },
windows: { en: 'Windows 11, x64 or Arm', es: 'Windows 11, x64 o Arm' },
};

export const owner = {
brand: 'Quackbyte',
brandUrl: 'https://quackbyte.dev/',
Expand Down
Loading
Loading