Setting Up the Events Page
The Events page syncs directly with Google Calendar. Follow this guide to generate your credentials and link your calendar to the CMS.
⚡ Quick Checklist
Section titled “⚡ Quick Checklist”Before you start, ensure you have:
- A Google Account with access to Google Cloud Console. You may have to enable 2FA.
- Admin access to your Netlify dashboard.
- Access to the Astro-Church CMS.
Step 1: Get a Google Calendar API Key
Section titled “Step 1: Get a Google Calendar API Key”-
Create a Project: Go to the Google Cloud Console. Click Select a project > New project. Create a Project named
your-github-repo-name. -
Enable APIs: In the sidebar, go to APIs & Services > Library. Search for “Google Calendar API” and click Enable.
-
Create Credentials: Navigate to APIs & Services > Credentials. Click + Create Credentials > API key
- Name:
your-github-repo-name - Application restrictions:
Websites - API restrictions: Check
Restrict keyand selectGoogle Calendar API - Click Create
- Name:
-
Copy the Key: Save this for step 3. You will need the key under
Your API Key.
Step 2: Configure Your Google Calendar
Section titled “Step 2: Configure Your Google Calendar”-
Open Google Calendar.
-
Select/Create Calendar: Click the Gear Icon > Settings. Under Add calendar, select Create new calendar (e.g.,
Community Events), or select an existing calendar. -
Make Calendar Public: In the sidebar, click your calendar name.
- Under Access permissions for events, check Make available to public.
- Set the dropdown to See all event details
-
Find Calendar ID: Scroll down to the Integrate calendar section. Copy the
Calendar ID(it usually looks like an email address or ends in @group.calendar.google.com).
Step 3: Add Variables to Netlify
Section titled “Step 3: Add Variables to Netlify”To connect the data, add these keys to your hosting environment:
-
In Netlify, go to Project confiuration > Environment variables
-
Click Add a variable > Add a single variable for each:
| Key | Value |
|---|---|
PUBLIC_GOOGLE_CALENDAR_API_KEY | Your API Key from Step 1 |
PUBLIC_GOOGLE_CALENDAR_ID | Your Calendar ID from Step 2 |
Step 4: Activate the Events Page
Section titled “Step 4: Activate the Events Page”-
Log in to Astro-Church CMS
-
Under Pages create exactly one page with the Type
events. This page can be named whatever you like. Nothing from theBodyfield will be shown on the page.