BlogRepresentation
The BlogRepresentation component displays a regional feed of Ghost CMS posts based on a country tag. It is used on representation pages to surface localized news and events.
Overview
Section titled “Overview”- Type: Blog Component
- Category: Representation content
- Complexity: Complex
- File:
src/components/BlogRepresentation.astro - Data config:
src/data/representation/blogRepresentation.ts
Features
Section titled “Features”- Country-specific filtering - Fetches posts by Ghost tags
- Configurable headings - Each country has custom copy
- Shared styling - Matches the primary Blog component
- Empty state - Displays a message when no tagged posts exist
import type { RepresentationCountry } from '../data/representation/blogRepresentation';
interface Props { country: RepresentationCountry;}Prop details
Section titled “Prop details”| Prop | Type | Default | Description |
|---|---|---|---|
country | RepresentationCountry | required | Country key used to look up heading and Ghost tags |
---import BlogRepresentation from '../../components/BlogRepresentation.astro';---
<BlogRepresentation country="finland" />---import BlogRepresentation from '../../components/BlogRepresentation.astro';---
<BlogRepresentation country="kingdom-denmark" />Data configuration
Section titled “Data configuration”The configuration maps countries to headings, descriptions, and Ghost tags.
export interface BlogRepresentationConfig { heading: string; description: string; tag: string | string[];}
export const blogRepresentationConfig = { finland: { heading: 'Latest from Finland', description: 'Stay updated with the latest news, events, and insights from FiNAN Finland.', tag: 'Finland', }, 'kingdom-denmark': { heading: 'Latest from Kingdom of Denmark', description: 'Stay updated with the latest news, events, and insights from FiNAN Kingdom of Denmark.', tag: ['Kingdom of Denmark', 'Denmark', 'Faroe Islands', 'Greenland'], },} as const;For editors
Section titled “For editors”Add a new country feed
Section titled “Add a new country feed”- Add a Ghost tag that matches the country name.
- Update
src/data/representation/blogRepresentation.tswith a new config entry. - Render the component on the target representation page.
Rendering behavior
Section titled “Rendering behavior”- Fetches up to 6 posts with
getBlogPostsByTag. - Uses the first tag name as a label when tags exist.
- Truncates excerpts to 200 characters.
Styling details
Section titled “Styling details”- Section background:
bg-gray-50 - Grid:
md:grid-cols-2andlg:grid-cols-3 - Cards: Hover shadow and image zoom on hover
Accessibility
Section titled “Accessibility”- Post titles include screen reader text for external links.
- Date and tag labels use readable contrast on gray pills.
Used on
Section titled “Used on”src/pages/representation/*.astro
Related components
Section titled “Related components”- Blog - Global FiNAN news feed
- Committee - Representation leadership section
- RegistrationSection - Registration grid used on representation pages
Related documentation
Section titled “Related documentation”Source code
Section titled “Source code”View the complete implementation:
https://github.com/poncardasm/finan-website/blob/main/src/components/BlogRepresentation.astrohttps://github.com/poncardasm/finan-website/blob/main/src/data/representation/blogRepresentation.tshttps://github.com/poncardasm/finan-website/blob/main/src/lib/ghost.ts