From 89078ca91aa36234ca66af52340f79020dc98ffb Mon Sep 17 00:00:00 2001 From: Chandula Adhikari Date: Tue, 3 Nov 2026 10:27:30 +0530 Subject: [PATCH] Add news form support and reusable links This change adds a reusable form link component and a Google Form for news and vacancies. It renames the profile-only component to FormLink, adds forms.news in src/data/site.ts, and updates the docs pages and site guidance to show the correct form links, repo references, and copy for both profile and news submissions. --- .../{ProfileFormLink.astro => FormLink.astro} | 32 +++++++++++++------ src/data/site.ts | 7 ++-- src/pages/docs/index.astro | 2 +- src/pages/docs/news.mdx | 23 +++++++++++++ src/pages/docs/profiles.mdx | 4 +-- src/pages/docs/site.mdx | 21 ++++++------ 6 files changed, 65 insertions(+), 24 deletions(-) rename src/components/{ProfileFormLink.astro => FormLink.astro} (58%) diff --git a/src/components/ProfileFormLink.astro b/src/components/FormLink.astro similarity index 58% rename from src/components/ProfileFormLink.astro rename to src/components/FormLink.astro index 513f0b0..48b8b61 100644 --- a/src/components/ProfileFormLink.astro +++ b/src/components/FormLink.astro @@ -1,9 +1,23 @@ --- -// "Use the profile form" box for the documentation guides (forms.profile in src/data/site.ts). +// "Use the … form" box for the documentation guides (forms in src/data/site.ts). import Button from "./ui/Button.astro"; import Icon from "./ui/Icon.astro"; import Todo from "./ui/Todo.astro"; import { forms, site } from "../data/site"; + +interface Props { + form: keyof typeof forms; +} + +const copy = { + profile: { name: "profile form", text: "Add or update your profile, photo and projects with one form.", repo: "marc_people" }, + news: { name: "news form", text: "Send a news article or a vacancy, with photos, or correct a published article.", repo: "marc_news" }, +} satisfies Record; + +const { form } = Astro.props; +const href = forms[form]; +const { name, text, repo } = copy[form]; +const linkSubject = `${name[0].toUpperCase()}${name.slice(1)} link`; --- { - forms.profile && ( - ) } -{!forms.profile && Set forms.profile in src/data/site.ts to the form's share link (marc_people/google-form/README.md, step 7).} +{!href && Set forms.{form} in src/data/site.ts to the form's share link ({repo}/google-form/README.md, step 7).}