Skip to content

Commit 0830fa3

Browse files
committed
Add global configuration for static constants and update report issue functionality
1 parent 9ca8a4b commit 0830fa3

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ Event data lives in `src/content/events/<event-id>/`:
6060
| `src/lib/popup.ts` | Leaflet popup HTML generation (`makePopupContent()`) |
6161
| `src/styles/global.css` | Design tokens (CSS custom properties), IBM Plex Sans, Leaflet overrides |
6262
| `src/content.config.ts` | Astro content collection Zod schema for events |
63+
| `src/config.ts` | Global static constants (contact email, etc.) |
64+
65+
## Global Configuration (`src/config.ts`)
66+
67+
Use `src/config.ts` for static, non-secret values that are referenced across multiple files or are likely to change. Import from it rather than hardcoding inline.
68+
69+
**Store here:**
70+
- Contact emails (e.g. `PCD_EMAIL`)
71+
- Stable URLs referenced in UI (e.g. a feedback form link)
72+
- Project-wide constants (e.g. site name, org name)
73+
74+
**Do not store here:**
75+
- Environment-specific or secret values — use `.env` with `import.meta.env` for those
76+
- Anything already defined in `astro.config.mjs` (e.g. base path)
77+
- Component-local constants that aren't shared
6378

6479
## UI / Styling Rules
6580

pcd-website/src/components/NodePanel.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { createFocusTrap, type FocusTrap } from 'focus-trap';
44
import { Icon } from '@iconify/vue';
55
import type { Node } from '../lib/nodes';
66
import { formatDateRange, formatTimeRange, calendarLinks, onlinePlatformName } from '../lib/format';
7+
import { PCD_EMAIL } from '../config';
78
const props = defineProps<{
89
node: Node | null;
910
}>();
@@ -182,7 +183,7 @@ async function copyLink(node: Node) {
182183
function getReportIssueHref(node: Node): string {
183184
const subject = `[Report] Issue with "${node.event_name}" page`;
184185
const body = `Hi PCD team,\n\nI would like to report an issue with the following page:\n\n- Name: "${node.event_name}"\n- Link: ${getShareUrl(node)}\n\n[Please describe the issue here].\n\nThank you!`;
185-
return `mailto:day@processingfoundation.org?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
186+
return `mailto:${PCD_EMAIL}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
186187
}
187188
</script>
188189

pcd-website/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const PCD_EMAIL = "day@processingfoundation.org";

0 commit comments

Comments
 (0)