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
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Existing violations are recorded in [arabterm/scripts/validation_baseline.json](

[website/](website/) is an [Astro](https://astro.build/) static site (deployed to <https://forzagreen.github.io/arabterm/>) that reads `arabterm.db` at build time (the gh-pages workflow runs `make db` first, since the unpacked file is not in the checkout) via `better-sqlite3` and emits one HTML page per dictionary (paginated 1000 terms / page) plus a per-dict JSON download. It's a third derived view of the DB alongside the SQLite and MariaDB dumps — no JSON is committed.

The «الجديد» button in the header ([WhatsNew.astro](website/src/components/WhatsNew.astro)) tells returning visitors what is new, once: the panel opens by itself when there is unseen news and closing it marks the news seen, in `localStorage` (`whatsNew`: feature ids and largest dictionary id — nothing is sent anywhere). Dictionaries added since the last visit are detected from the dictionary ids built into every page (`getDictionaryIndex()` in `db.ts`), so a new dictionary announces itself on the next deploy. Features are the hand-written `FEATURES` list in [whatsNew.ts](website/src/lib/whatsNew.ts): add an entry (stable `id`, date, plain Arabic for a non-technical reader, optional `media` animation) only for something a visitor of the site notices — never dependency or build changes — and prune entries after a few months. A first visit records the state silently. The same mechanism exists in wikitermbase with its own list.

Legacy unprefixed URLs from the original Angular site (e.g. `/water_engineering/`) are preserved as static HTML redirects to the canonical `name_tech` URL (`/at_water_engineering/`). The legacy slug list lives in `LEGACY_SLUGS` in [website/src/lib/db.ts](website/src/lib/db.ts) — never remove a legacy slug from this list, even if its underlying dictionary changes.

[`.github/workflows/gh-pages.yml`](.github/workflows/gh-pages.yml) runs `npm run build` inside `website/` on every push to `main` and uploads `website/dist/` to GitHub Pages.
Expand Down
3 changes: 3 additions & 0 deletions website/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
import WhatsNew from './WhatsNew.astro';

const base = import.meta.env.BASE_URL;
---
<header class="site-header">
Expand All @@ -11,6 +13,7 @@ const base = import.meta.env.BASE_URL;
<a href="https://wikitermbase.toolforge.org/" target="_blank" rel="noopener">مسرد الويكي</a>
<a href="https://github.com/forzagreen/arabterm" target="_blank" rel="noopener">GitHub</a>
</nav>
<WhatsNew />
<div class="theme-switch" role="group" aria-label="نمط العرض">
<button type="button" data-theme-value="auto" aria-pressed="false" title="تلقائي" aria-label="تلقائي">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
Expand Down
Loading