Skip to content

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.

Before you start, ensure you have:

  1. Create a Project: Go to the Google Cloud Console. Click Select a project > New project. Create a Project named your-github-repo-name.

  2. Enable APIs: In the sidebar, go to APIs & Services > Library. Search for “Google Calendar API” and click Enable.

  3. Create Credentials: Navigate to APIs & Services > Credentials. Click + Create Credentials > API key

    • Name: your-github-repo-name
    • Application restrictions: Websites
    • API restrictions: Check Restrict key and select Google Calendar API
    • Click Create
  4. Copy the Key: Save this for step 3. You will need the key under Your API Key.

  1. Open Google Calendar.

  2. Select/Create Calendar: Click the Gear Icon > Settings. Under Add calendar, select Create new calendar (e.g., Community Events), or select an existing calendar.

  3. 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
  4. 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).

To connect the data, add these keys to your hosting environment:

  1. In Netlify, go to Project confiuration > Environment variables

  2. Click Add a variable > Add a single variable for each:

KeyValue
PUBLIC_GOOGLE_CALENDAR_API_KEYYour API Key from Step 1
PUBLIC_GOOGLE_CALENDAR_IDYour Calendar ID from Step 2
  1. Log in to Astro-Church CMS

  2. Under Pages create exactly one page with the Type events. This page can be named whatever you like. Nothing from the Body field will be shown on the page.