Skip to content

Commit c9ea588

Browse files
committed
addressing checker issues
1 parent 5c88738 commit c9ea588

File tree

4 files changed

+105
-39
lines changed

4 files changed

+105
-39
lines changed

AGENTS.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AGENTS.md
2+
3+
## Purpose
4+
This repo is the Astro-powered marketing site for the Kyoto Tech Meetup community.
5+
6+
## Key References (Read First)
7+
- `README.md` for setup, scripts, and contribution workflow.
8+
- i18n strings and locale wiring:
9+
- `src/i18n/ui.ts` (string tables + default language)
10+
- `src/i18n/utils.ts` (translation helper + fallback behavior)
11+
- `astro.config.mjs` (Astro i18n locales/default)
12+
- `src/pages/index.astro` and `src/pages/ja/index.astro` (locale routing)
13+
- `src/components/LanguagePicker.astro` and `src/layouts/Layout.astro` (language switch + meta)
14+
- RSS/community feed JSON:
15+
- `src/data/member-feeds.json` (source list)
16+
- `src/data/composite-feed.json` (generated output consumed by UI)
17+
- `scripts/fetch-feeds.mjs` (RSS aggregator that writes the JSON above)
18+
19+
## Quick Start
20+
- Install: `npm install`
21+
- Dev server: `npm run dev` (http://localhost:4321)
22+
- Checks: `npm run check`
23+
- Build: `npm run build`
24+
- Preview: `npm run preview`
25+
26+
## i18n Rules
27+
- Add/modify strings in `src/i18n/ui.ts` under both `en` and `ja`.
28+
- Keep keys aligned across locales; `useTranslations` falls back to `defaultLang`.
29+
- Prefer `useTranslations(lang)` in Astro/React components instead of inline strings.
30+
- New locale pages should mirror the base page structure (`src/pages/ja/...`).
31+
32+
## Editing Guidelines
33+
- Keep Tailwind usage consistent with existing patterns.
34+
- Prefer editing existing Astro/React components over adding new ones.
35+
- Do not edit `dist/` (build output).
36+
- If adding dependencies, update both `package.json` and `package-lock.json`.
37+
38+
## Data Notes
39+
- `src/data/composite-feed.json` is generated; update via `scripts/fetch-feeds.mjs`.
40+
- `src/data/member-feeds.json` is the source-of-truth for aggregated RSS feeds.

src/components/Hero.astro

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
import LanguagePicker from "./LanguagePicker.astro";
3+
4+
type Props = {
5+
tagline: string;
6+
title: string;
7+
subtitle: string;
8+
};
9+
10+
const { tagline, title, subtitle } = Astro.props as Props;
11+
const heroImageSrc =
12+
"https://images.unsplash.com/photo-1570463723985-41c39db0343d?q=80&w=1335&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D?auto=format&fit=crop&w=2000&q=80";
13+
---
14+
15+
<header
16+
class="relative isolate flex min-h-[70vh] items-center px-6 py-20 text-white sm:py-28 md:px-16"
17+
>
18+
<div class="absolute inset-0 -z-10">
19+
<img
20+
src={heroImageSrc}
21+
alt=""
22+
loading="lazy"
23+
fetchpriority="high"
24+
decoding="async"
25+
class="h-full w-full object-cover"
26+
/>
27+
<div class="absolute inset-0 bg-black/40"></div>
28+
</div>
29+
<div class="mx-auto max-w-3xl text-center md:ml-[5%] md:text-left">
30+
<p class="text-xs font-semibold uppercase tracking-[0.3em] text-white/80">
31+
{tagline}
32+
</p>
33+
<h1
34+
class="mt-4 text-4xl font-semibold leading-tight text-white md:text-5xl"
35+
>
36+
{title}
37+
</h1>
38+
<p class="mt-4 text-lg text-white/90">{subtitle}</p>
39+
</div>
40+
<LanguagePicker />
41+
</header>

src/layouts/Layout.astro

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ const hrefEn = `${SITE_URL}/`;
1212
const hrefJa = `${SITE_URL}/ja/`;
1313
const ogLocale = activeLang === "ja" ? "ja_JP" : "en_US";
1414
const ogLocaleAlternate = activeLang === "ja" ? "en_US" : "ja_JP";
15+
const gtmId = "GTM-5SB4S7NJ";
16+
const gtmScript = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({"gtm.start":
17+
new Date().getTime(),event:"gtm.js"});var f=d.getElementsByTagName(s)[0],
18+
j=d.createElement(s),dl=l!="dataLayer"?"&l="+l:"";j.async=true;j.src=
19+
"https://www.googletagmanager.com/gtm.js?id="+i+dl;f.parentNode.insertBefore(j,f);
20+
})(window,document,"script","dataLayer","${gtmId}");`;
21+
const gtmNoscriptSrc = `https://www.googletagmanager.com/ns.html?id=${gtmId}`;
1522
const orgDescription =
1623
activeLang === "ja"
1724
? "京都でテクノロジーを探求するデベロッパー、デザイナー、研究者、ファウンダーのための集まり。"
@@ -139,11 +146,7 @@ const ldData = {
139146
<meta name="generator" content={Astro.generator} />
140147

141148
<!-- Google Tag Manager -->
142-
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
143-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
144-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
145-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
146-
})(window,document,'script','dataLayer','GTM-5SB4S7NJ');</script>
149+
<script is:inline set:html={gtmScript}></script>
147150
<!-- End Google Tag Manager -->
148151

149152
<meta
@@ -182,8 +185,15 @@ const ldData = {
182185
<body>
183186

184187
<!-- Google Tag Manager (noscript) -->
185-
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5SB4S7NJ"
186-
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
188+
<noscript>
189+
<iframe
190+
src={gtmNoscriptSrc}
191+
height="0"
192+
width="0"
193+
style="display:none;visibility:hidden"
194+
title="Google Tag Manager"
195+
></iframe>
196+
</noscript>
187197
<!-- End Google Tag Manager (noscript) -->
188198

189199
<a class="skip-link" href="#main-content">{t("a11y.skipToMain")}</a>

src/pages/index.astro

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2+
/* eslint-disable max-lines */
23
import Layout from "../layouts/Layout.astro";
4+
import Hero from "../components/Hero.astro";
35
import WhyJoin from "../components/WhyJoin.astro";
46
import WhatWeDo from "../components/WhatWeDo.astro";
57
import Calendar from "../components/Calendar.astro";
68
import Footer from "../components/Footer.astro";
79
import { FaGithub, FaDiscord, FaMeetup, FaEnvelope } from "react-icons/fa";
810
import { FaRegClock, FaRegCalendarAlt } from "react-icons/fa";
911
import { useTranslations } from "../i18n/utils";
10-
import LanguagePicker from "../components/LanguagePicker.astro";
1112
import memberFeeds from "../data/member-feeds.json";
1213
import compositeFeed from "../data/composite-feed.json";
1314
import eventLocations from "../data/event-locations.json";
@@ -196,35 +197,11 @@ const nextUpdate = compositeFeed?.generatedAt
196197
---
197198

198199
<Layout>
199-
<header
200-
class="relative isolate flex min-h-[70vh] items-center px-6 py-20 text-white sm:py-28 md:px-16"
201-
>
202-
<div class="absolute inset-0 -z-10">
203-
<img
204-
src="https://images.unsplash.com/photo-1570463723985-41c39db0343d?q=80&w=1335&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D?auto=format&fit=crop&w=2000&q=80"
205-
alt=""
206-
loading="lazy"
207-
fetchpriority="high"
208-
decoding="async"
209-
class="h-full w-full object-cover"
210-
/>
211-
<div class="absolute inset-0 bg-black/40"></div>
212-
</div>
213-
<div class="mx-auto max-w-3xl text-center md:ml-[5%] md:text-left">
214-
<p class="text-xs font-semibold uppercase tracking-[0.3em] text-white/80">
215-
{t("home.header.tagline")}
216-
</p>
217-
<h1
218-
class="mt-4 text-4xl font-semibold leading-tight text-white md:text-5xl"
219-
>
220-
{t("home.header.title")}
221-
</h1>
222-
<p class="mt-4 text-lg text-white/90">
223-
{t("home.header.subtitle")}
224-
</p>
225-
</div>
226-
<LanguagePicker />
227-
</header>
200+
<Hero
201+
tagline={t("home.header.tagline")}
202+
title={t("home.header.title")}
203+
subtitle={t("home.header.subtitle")}
204+
/>
228205

229206
<main id="main-content" class="space-y-0">
230207
<section id="quick-links" class="bg-white/90 px-6 py-12 md:px-12">
@@ -348,7 +325,6 @@ const nextUpdate = compositeFeed?.generatedAt
348325
feedsWithItems.map((feed) => (
349326
<article
350327
class="flex h-full flex-col overflow-visible rounded-2xl border border-slate-200/70 bg-white/95 p-5 shadow-lg shadow-stone-900/5 ring-1 ring-white/80"
351-
key={feed.feedUrl}
352328
>
353329
<div class="flex flex-wrap items-center gap-3">
354330
<h4 class="text-lg font-semibold text-slate-900">
@@ -384,7 +360,6 @@ const nextUpdate = compositeFeed?.generatedAt
384360
{feed.items.map((item) => (
385361
<div
386362
class="group relative z-0 min-w-[280px] max-w-md flex-1 rounded-xl border border-slate-100 bg-slate-50/70 p-3 pb-10 transition hover:border-(--accent) hover:bg-white hover:z-10 after:clear-both after:block after:content-['']"
387-
key={item.id}
388363
>
389364
{item.image ? (
390365
<div class="float-right ml-3 mb-2 h-24 w-28 overflow-hidden rounded-lg border border-slate-100 bg-slate-100">

0 commit comments

Comments
 (0)