Compare commits

...

7 Commits

Author SHA1 Message Date
akcodez
abb7f1e313 change test event 2024-12-11 11:35:49 -08:00
Aria Keshmiri
088812f438 Merge branch 'master' into events-json-contentful-gh-actions 2024-12-11 11:13:34 -08:00
akcodez
54e27d8764 adds new workflow logic and sync pages with contentful logix 2024-12-11 10:44:10 -08:00
akcodez
1986131019 Merge remote-tracking branch 'origin' into events-json-contentful-gh-actions 2024-12-04 08:08:23 -08:00
akcodez
ee410de46c fix community page incorporate events from json 2024-12-03 12:59:22 -08:00
akcodez
75f87bbc95 change base branch for testing purposes 2024-12-03 12:40:56 -08:00
akcodez
acd3eefebc add basis of logic 2024-12-03 12:37:19 -08:00
6 changed files with 1307 additions and 1396 deletions

View File

@@ -0,0 +1,79 @@
name: Update Contentful Data
on:
repository_dispatch:
types: [contentful_update]
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Dependencies
run: npm install
- name: Set Branch Name with Date
id: set-branch-name
run: echo "BRANCH_NAME=contentful-updates-$(date +'%Y-%m-%d-%H-%M')" >> $GITHUB_ENV
- name: Fetch Data from Contentful
env:
CONTENTFUL_SPACE_ID: ${{ secrets.CONTENTFUL_SPACE_ID }}
CONTENTFUL_ACCESS_TOKEN: ${{ secrets.CONTENTFUL_ACCESS_TOKEN }}
run: node scripts/fetchContentfulData.cjs
- name: Check for changes
id: check_changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "no_changes=true" >> $GITHUB_OUTPUT
else
echo "no_changes=false" >> $GITHUB_OUTPUT
fi
- name: No changes found
if: steps.check_changes.outputs.no_changes == 'true'
run: echo "No changes found. Skipping commit and pull request steps."
- name: Commit and Push Changes
if: steps.check_changes.outputs.no_changes == 'false'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Update data from Contentful'
branch: ${{ env.BRANCH_NAME }}
create_branch: true
- name: Create Pull Request
if: steps.check_changes.outputs.no_changes == 'false'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: existingPulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
head: `${context.repo.owner}:${process.env.BRANCH_NAME}`,
state: 'open',
});
if (existingPulls.length === 0) {
const { data: pullRequest } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
head: process.env.BRANCH_NAME,
base: 'master',
title: 'Update data from Contentful',
body: 'Automated update of data from Contentful.',
});
console.log(`Pull request created: ${pullRequest.html_url}`);
} else {
console.log('Pull request already exists:', existingPulls[0].html_url);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,340 +1,10 @@
import React, { useEffect, useState } from "react";
import { useThemeHooks } from "@redocly/theme/core/hooks";
import React, { useState, useEffect } from "react";
import moment from "moment";
import { useThemeHooks } from "@redocly/theme/core/hooks";
import base_events from "../static/JSON/events.json";
import contentful_events from "../static/JSON/contentful-events.json";
import { Link } from "@redocly/theme/components/Link/Link";
const infoSession = require("../static/img/events/InfoSessions.png");
export const frontmatter = {
seo: {
title: "Community",
description:
"The XRP Ledger (XRPL) is a community-driven public blockchain. Heres how you can get involved.",
},
};
const amaImage = require("../static/img/events/AMAs.png");
const hackathon = require("../static/img/events/Hackathons.png");
const conference = require("../static/img/events/Conference.png");
const zone = require("../static/img/events/XRPLZone.png");
const brazil = require("../static/img/events/event-meetup-brazil.png");
const infoSession2 = require("../static/img/events/xrpl-builder-office-hours-02.png");
const infoSession3 = require("../static/img/events/xrpl-builder-office-hours-03.png");
const infoSession4 = require("../static/img/events/xrpl-builder-office-hours-04.png");
const events = [
{
name: "New Horizon: Innovate Without Limits: New Horizons Await",
description:
"Join our EVM-compatible chain launch for a chance to win $50,000 in prizes! Unleash your creativity in DeFi and NFTs, with judging criteria focused on novelty, impact, and community engagement.",
type: "hackathon",
link: "https://newhorizon.devpost.com/",
location: "Virtual",
date: "October 19, 2023 - December 22, 2023",
image: hackathon,
end_date: "December 22, 2023",
start_date: "October 19, 2023",
},
{
name: "XRPL Community Report Launch Party",
description:
"Celebrate the XRPL Community Report launch at 7pm! Join blockchain enthusiasts, connect with experts, and discover opportunities in the XRP Ledger ecosystem. Limited space available, so register now for a night of celebration and networking!",
type: "meetup",
link: "https://www.eventbrite.fr/e/billets-xrpl-community-report-launch-party-753788370307",
location: "Paris, France",
date: "November 28, 7pm - 9pm",
image: require("../static/img/events/paris.png"),
end_date: "November 28, 2023",
start_date: "November 28, 2023",
},
{
name: "XRPL Grants Info Session: Decentralized Exchange (DEX) Focused",
description:
"Watch the recorded information session and Q&A on applying to XRPL Grants Wave 7. This session will provide a general overview of the XRPL Grants application for Wave 7, with a focus on Decentralized Exchange (DEX) projects.",
type: "info-session",
link: "https://www.youtube.com/watch?v=BbGu0QC5WEE",
location: "Virtual - Zoom",
date: "September 06, 2023",
image: infoSession,
end_date: "September 06, 2023",
start_date: "September 06, 2023",
},
{
name: "XRPL Developers Reddit AMA: Real World Assets",
description:
"Join us for a live chat on Reddit and learn more about how developers are building real world assets with confidence on the XRP Ledger.",
type: "ama",
link: "https://xrplresources.org/rwa-ama?utm_source=web&utm_medium=web&utm_campaign=bwc",
location: "Virtual - Reddit",
date: "October 17, 2023",
image: amaImage,
end_date: "October 17, 2023",
start_date: "October 17, 2023",
},
{
name: "XRP Ledger Zone ETHDenver",
description:
"XRPL Zone: your all-in-one location for creating and collaborating on XRP Ledger (XRPL) projects. Details coming soon!",
type: "zone",
link: "http://xrplzone-ethdenver.splashthat.com",
location: "Denver, Colorado",
date: "February 27, 2024",
image: zone,
end_date: "February 27, 2024",
start_date: "February 27, 2024",
},
{
name: "XRPL Developers Discord AMA: Apex 2024",
description:
"Join the DevRel team at Ripple to learn more about APEX 2024.",
type: "ama",
link: "https://discord.gg/gszzRTxV?event=1215341725825110089",
location: "XRPL Developers Discord",
date: "March 13, 2024 13:00 EST",
image: amaImage,
start_date: "March 13, 2024",
end_date: "March 13, 2024",
},
{
name: "Paris Blockchain Week",
description:
"Paris Blockchain Week is Europe's biggest blockchain & digital assets event that covers all aspects of blockchain technology.",
type: "conference",
link: "https://www.parisblockchainweek.com/",
location: "Paris, France",
date: "April 9 - 12, 2024",
image: conference,
end_date: "April 12, 2024",
start_date: "April 9, 2024",
},
{
name: "Consensus",
description:
"Join us at Consensus! This event is the world's largest, longest-running and most influential gathering that brings together all sides of the cryptocurrency, blockchain and Web3 community.",
type: "conference",
link: "https://consensus.coindesk.com/?utm_campaign=&utm_content=c24&utm_medium=sponsored&utm_source=XRPLEventsPage%20&utm_term=organic",
location: "Austin, Texas",
date: "May 29 - June 1, 2024",
image: conference,
end_date: "June 1, 2024",
start_date: "May 29, 2024",
},
{
name: "EasyA Ripple Hackathon",
description:
"Join the XRPL community at the Ripple x EasyA Hackathon in Amsterdam, where startups can compete for a $20,000 prize and a chance to present at the prestigious APEX Conference alongside industry leaders. Secure your spot now! ",
type: "hackathon",
link: "https://www.eventbrite.co.uk/e/easya-x-ripple-apex-hackathon-win-20000-tickets-882724261027?aff=oddtdtcreator",
location: "Amsterdam",
date: "June 8 - 9, 2024",
image: hackathon,
start_date: "June 8, 2024",
end_date: "June 9, 2024",
},
{
name: "APEX 2024: The XRPL Developer Summit",
description:
"Apex XRPL Developer Summit is the annual event where developers, contributors, and thought leaders come together to learn, build, share, network, and celebrate all things XRP Ledger.",
type: "conference",
link: "http://apexdevsummit.com",
location: "Amsterdam",
date: "June 11 - 13, 2024",
image: conference,
end_date: "June 13, 2024",
start_date: "June 11, 2024",
},
{
name: "SwissHacks",
description:
"Transform Fintech with XRPL at SwissHacks 2024! Prototype and collaborate with fellow builders to reinvent finance for a brighter future",
type: "hackathon",
link: "https://airtable.com/app61tk91vkuwKhGx/pagCN29Br8RdxTvp7/form",
location: "Zurich",
date: "June 28 - 30, 2024",
image: hackathon,
start_date: "June 28, 2024",
end_date: "June 30, 2024",
},
{
name: "XRPL Meetup Blockchain Rio",
description:
"Get ready to kick off Blockchain Rio with a bang at the XRP Ledger Dev Meetup! Hosted by the the XRP Ledger team, this warm-up event is the perfect chance for devs and builders to connect, share ideas, and get hyped for the main event. Expect a night filled with great conversations, delicious drinks, and the vibrant energy of Rio de Janeiro. Don't miss out on this fantastic opportunity to network and have a blast with fellow tech enthusiasts. See you there!",
type: "meetup",
link: "https://lu.ma/4uxpkd11",
location: "Rio de Janeiro",
date: "July 23, 2024",
image: brazil,
start_date: "July 23, 2024",
end_date: "July 23, 2024",
},
{
name: "XRPL Builder Office Hours",
description:
"XRPL Builder Office Hours is an open forum hosted monthly by Developer Advocates to answer technical and business questions from community members.",
type: "info-session",
link: "https://ripple.zoom.us/meeting/register/tJMscOCsrDoiHNUN6hZLpFVR69OcfG9rXtIA#/registration",
location: "Virtual - Zoom",
date: "August 23, 2024",
image: infoSession,
start_date: "August 23, 2024",
end_date: "August 23, 2024",
},
{
name: "XRP Ledger Hackathon Seoul 2024",
description:
"Calling all developers in Korea or attending Korea Blockchain Week! Join us for an exclusive pre-KBW meetup in Gangnam, Seoul! Be part of an exciting opportunity to collaborate with fellow builders leveraging the XRP Ledger. Dont miss this chance to connect with industry peers, explore local funding initiatives, and fuel your projects with new insights just before the main KBW event!",
type: "hackathon",
link: "https://lu.ma/1viq6evg",
location: "Seoul, South Korea",
date: "August 31 - September 1, 2024",
image: hackathon,
start_date: "August 31, 2024",
end_date: "September 1, 2024",
},
{
name: "XRPL Zone Seoul",
description:
"Join us at XRPL Zone Seoul where developers, corporates, fintechs, banks, VCs, academia, and the XRP community come together under one roof for the biggest XRPL event in South Korea!",
type: "zone",
link: "https://ripple.swoogo.com/xrpl-zone-seoul",
location: "Seongdong-su, Seoul",
date: "September 4, 2024",
image: require('../static/img/events/event-meetup-zone-day.png'),
start_date: "September 4, 2024",
end_date: "September 4, 2024",
},
{
name: "XRPL Zone Seoul After Hours",
description:
"Celebrate with the XRP Community during Korea Blockchain Week! Don't miss this opportunity to mingle with the vibrant XRP community, visionary XRPL developers, trailblazing innovators, and influential investors.",
type: "meetup",
link: "https://lu.ma/mbg067j3",
location: "Seongdong-su, Seoul",
date: "September 4, 2024",
image: require('../static/img/events/event-meetup-zone-night.png'),
start_date: "September 4, 2024",
end_date: "September 4, 2024",
},
{
name: "XRP Community Day Tokyo",
description:
"Join senior execs from Ripple, prominent Japanese institutions, and the XRP community for a day of inspiration, networking and insights.",
type: "meetup",
link: "https://events.xrplresources.org/toyko-community-2024",
location: "Shinagawa, Tokyo",
date: "September 6, 2024",
image: require('../static/img/events/event-meetup-tokyo-day.png'),
start_date: "September 6, 2024",
end_date: "September 6, 2024",
},
{
name: "XRP Community Night Tokyo",
description:
"Celebrate with the XRP Community in Tokyo! Don't miss this opportunity to mingle with the vibrant XRP community, visionary developers, trailblazing innovators, and influential VCs.",
type: "meetup",
link: "https://lu.ma/84do37p7",
location: "Shinagawa, Tokyo",
date: "September 6, 2024",
image: require('../static/img/events/event-meetup-tokyo-night.png'),
start_date: "September 6, 2024",
end_date: "September 6, 2024",
},
{
name: "Chicago XRP Ledger Meet Up",
description:
"Hey Chicago XRP Ledger community! Were hosting a meetup soon—come hang out, share ideas, and talk all things XRPL. Would love to see you there!",
type: "meetup",
link: "https://lu.ma/74dulzff",
location: "Chicago, IL",
date: "September 12, 2024",
image: require('../static/img/events/chicago-meetup.png'),
start_date: "September 12, 2024",
end_date: "September 12, 2024",
},
{
name: "San Francisco XRP Ledger Meet Up",
description:
"Hello San Francisco XRP Ledger community! We're hosting a meetup soon with a focus on ZK research. Excited to see you soon!",
type: "meetup",
link: "https://lu.ma/evdklm4r",
location: "San Francisco, California",
date: "September 26, 2024",
image: require('../static/img/events/sf-meetup.jpg'),
start_date: "September 26, 2024",
end_date: "September 26, 2024",
},
{
name: "XRPL Builder Office Hours",
description:
"XRPL Builder Office Hours is an open forum hosted monthly by Developer Advocates to answer technical and business questions from community members.",
type: "info",
link: "https://ripple.zoom.us/meeting/register/tJMscOCsrDoiHNUN6hZLpFVR69OcfG9rXtIA",
location: "Virtual - Zoom",
date: "September 27, 2024",
image: infoSession2,
start_date: "September 27, 2024",
end_date: "September 27, 2024",
},
{
name: "AI Fund - XRPL Grants Info Session",
description:
"Join our info session to learn about our new XRPL Grants' AI Fund, designed to support innovative projects that leverage artificial intelligence in the XRPL ecosystem.",
type: "info",
link: "https://ripple.zoom.us/webinar/register/WN__SNDW7LTSM29h5NIpvXFvg#/registration",
location: "Virtual - Zoom",
date: "October 2, 2024",
image: infoSession,
start_date: "October 2, 2024",
end_date: "October 2, 2024",
},
{
name: "XRPL Meetup @ Permissionless III - by xrpcafe",
description:
"Get ready for an unforgettable evening at the XRPL Meetup - Permissionless III in the heart of Salt Lake City! Join us on October 10th from 6 PM to 9 PM at the lively Squatters Pub Brewery.",
type: "meetup",
link: "https://lu.ma/71ag93un?locale=en-GB",
location: "Salt Lake City, Utah",
date: "October 10, 2024",
image: require('../static/img/events/salt-lake-city.jpg'),
start_date: "October 10, 2024",
end_date: "October 10, 2024",
},
{
name: "XRPL Builder Office Hours",
description:
"XRPL Builder Office Hours is an open forum hosted monthly by Developer Advocates to answer technical and business questions from community members.",
type: "info",
link: "https://ripple.zoom.us/meeting/register/tJMscOCsrDoiHNUN6hZLpFVR69OcfG9rXtIA",
location: "Virtual - Zoom",
date: "October 25, 2024",
image: infoSession3,
start_date: "October 25, 2024",
end_date: "October 25, 2024",
},
{
name: "XRPL Meetup NYC",
description:
"Get ready for an unforgettable evening at the XRPL Meetup NYC!",
type: "meetup",
link: "https://xrpl.at/Aquarium-XRPL-Residency-DemoDay4",
location: " New York, New York",
date: "November 19, 2024",
image: require('../static/img/events/new-york.jpeg'),
end_date: "November 19, 2024",
start_date: "November 19, 2024",
},
{
name: "XRPL Builder Office Hours",
description:
"XRPL Builder Office Hours is an open forum hosted monthly by Developer Advocates to answer technical and business questions from community members.",
type: "info",
link: "https://ripple.zoom.us/meeting/register/tJMscOCsrDoiHNUN6hZLpFVR69OcfG9rXtIA",
location: "Virtual - Zoom",
date: "November 22, 2024",
image: infoSession4,
start_date: "November 22, 2024",
end_date: "November 22, 2024",
},
];
const allEvents = base_events.concat(contentful_events)
const findNearestUpcomingEvent = (events) => {
let nearestEvent = null;
let nearestDateDiff = Infinity;
@@ -356,8 +26,7 @@ const findNearestUpcomingEvent = (events) => {
const XrplEventsAndCarouselSection = ({ events }) => {
const { useTranslate } = useThemeHooks();
const { translate } = useTranslate();
const { translate } = useTranslate();
// State variables for the nearest event
const [nearestEventInfo, setNearestEventInfo] = useState({
nearestEvent: null,
@@ -435,20 +104,24 @@ const XrplEventsAndCarouselSection = ({ events }) => {
<div className="upcoming-event" id="upcoming-events-section">
<p className="upcoming-label">{translate("UPCOMING EVENT")}</p>
<div id="days-count" className="days-count">
{nearestEventInfo.nearestDateDiff}
{nearestEventInfo.nearestDateDiff}
</div>
<div className="days-word">{translate("days")}</div>
<div className="num-separator"></div>
<h5 id="upcoming-event-name" className="event-name">
{translate(nearestEventInfo.nearestEvent?.name)}
{translate(nearestEventInfo.nearestEvent?.name)}
</h5>
<p className="mb-2 event-details d-flex icon">
<span className="icon-location"></span>
<span id="upcoming-event-date">{nearestEventInfo.nearestEvent?.date}</span>
<span id="upcoming-event-date">
{nearestEventInfo.nearestEvent?.date}
</span>
</p>
<p className="event-location d-flex icon">
<span className="icon-date" id="upcoming-event-location"></span>
<span id="location-tag">{nearestEventInfo.nearestEvent?.location}</span>
<span id="location-tag">
{nearestEventInfo.nearestEvent?.location}
</span>
</p>
</div>
)}
@@ -466,14 +139,14 @@ const XrplEventsAndCarouselSection = ({ events }) => {
<img
id="left-image"
alt="Left Event Image"
src={prevEvent ? prevEvent.image : ""}
src={prevEvent ? (prevEvent.image.startsWith('https://') ? prevEvent.image : `/img/events/${prevEvent.image}`) : ""}
style={{ visibility: prevEvent ? "visible" : "hidden" }}
/>
<div className="center-image-wrapper">
<img
id="center-image"
alt="Featured Event Image"
src={currentEvent ? currentEvent.image : ""}
src={currentEvent ? (currentEvent.image.startsWith('https://') ? currentEvent.image : `/img/events/${currentEvent.image}`) : ""}
onClick={() =>
currentEvent && window.open(currentEvent.link, "_blank")
}
@@ -495,7 +168,7 @@ const XrplEventsAndCarouselSection = ({ events }) => {
<img
id="right-image"
alt="Right Event Image"
src={nextEvent ? nextEvent.image : ""}
src={nextEvent ? (nextEvent.image.startsWith('https://') ? nextEvent.image : `/img/events/${nextEvent.image}`) : ""}
style={{ visibility: nextEvent ? "visible" : "hidden" }}
/>
</div>
@@ -514,6 +187,7 @@ const XrplEventsAndCarouselSection = ({ events }) => {
};
const CommunityPage: React.FC = () => {
const events = allEvents.filter((event) => event.community)
const { useTranslate } = useThemeHooks();
const { translate } = useTranslate();
return (
@@ -809,16 +483,17 @@ const CommunityPage: React.FC = () => {
{/* Bottom Cards Section 2 cards */}
<section className="bottom-cards-section bug-bounty">
<div className="com-card">
<img className="top-right-img bug-bounty-card-bg" alt="Top Right Image" />
<img
className="top-right-img bug-bounty-card-bg"
alt="Top Right Image"
/>
<div className="card-content">
<h6 className="card-title">
{translate("RippleX Bug Bounty Program")}
</h6>
<h6 className="card-subtitle">
{translate(
"Contribute to the XRP Ledger's"
)}
<br/>
{translate("Contribute to the XRP Ledger's")}
<br />
Security
</h6>
<p className="card-description">
@@ -826,14 +501,14 @@ const CommunityPage: React.FC = () => {
"RippleXs Bug Bounty, part of Ripple's 1 Billion XRP pledge, strengthens XRP Ledger security and supports its ecosystem."
)}
<p className="card-description">
{
translate("Use this program to report bugs in RippleX/rippled. Send a detailed report of a qualifying bug to ")
}
<a href="mailto:bugs@ripple.com">bugs@ripple.com</a>
{
translate(" and use the ")
}
<a href="https://ripple.com/files/bug-bounty.asc">Public Key.</a>
{translate(
"Use this program to report bugs in RippleX/rippled. Send a detailed report of a qualifying bug to "
)}
<a href="mailto:bugs@ripple.com">bugs@ripple.com</a>
{translate(" and use the ")}
<a href="https://ripple.com/files/bug-bounty.asc">
Public Key.
</a>
</p>
</p>
<div className="card-links">
@@ -848,13 +523,14 @@ const CommunityPage: React.FC = () => {
</div>
</div>
<div className="com-card">
<img className="bottom-right-img bug-bounty-card-bg-2" alt="Bottom Right Image" />
<img
className="bottom-right-img bug-bounty-card-bg-2"
alt="Bottom Right Image"
/>
<div className="card-content">
<h6 className="card-title">{translate("Report a Scam")}</h6>
<h6 className="card-subtitle pr-bt28">
{translate(
"Report Scams to Safeguard Our Community"
)}
{translate("Report Scams to Safeguard Our Community")}
</h6>
<p className="card-description">
{translate(

View File

@@ -0,0 +1,81 @@
const fs = require('fs');
const path = require('path');
const moment = require('moment');
const contentful = require('contentful');
require('dotenv').config();
const eventTypeLookup = {
hackathon: 'hackathon',
meetup: 'meetup',
ama: 'ama',
conference: 'conference',
'community-call': 'cc',
'xrpl-zone': 'zone',
'info-session': 'info',
}
const imageFallbackLookup = {
hackathon: 'Hackathons.png',
meetup: '', // should not be blank from contentful
ama: 'AMAs.png',
conference: 'Conference.png',
'community-call': 'CommunityCalls.png',
'xrpl-zone': 'XRPLZone.png',
'info-session': 'InfoSessions.png',
}
const space = process.env.CONTENTFUL_SPACE_ID;
const accessToken = process.env.CONTENTFUL_ACCESS_TOKEN;
const client = contentful.createClient({
space,
accessToken,
});
async function fetchData() {
try {
const entries = await client.getEntries();
const data = entries.items.map((item) => {
// Edit: Format the dates to match events.json format
const startDate = moment(item.fields.startDate);
const endDate = moment(item.fields.endDate);
const startDateFormatted = startDate.format('MMMM D, YYYY');
const endDateFormatted = endDate.format('MMMM D, YYYY');
const sameDay = startDate.isSame(endDate, 'day');
const sameMonth = startDate.isSame(endDate, 'month');
const sameYear = startDate.isSame(endDate, 'year');
let dateString;
if (sameDay) {
dateString = startDateFormatted;
} else if (sameYear && sameMonth) {
dateString = `${startDate.format('MMMM D')} - ${endDate.format('D, YYYY')}`;
} else if (sameYear) {
dateString = `${startDate.format('MMMM D')} - ${endDateFormatted}`;
} else {
dateString = `${startDateFormatted} - ${endDateFormatted}`;
}
const eventType = (item.fields.category[0]).toLocaleLowerCase();
return {
name: item.fields.name,
description: item.fields.description,
type: eventTypeLookup[eventType],
link: item.fields.link,
location: item.fields.location,
date: dateString,
image: item?.fields?.image?.fields?.file?.url ? `https:${item.fields.image.fields.file.url}` : imageFallbackLookup[eventType],
end_date: endDateFormatted,
start_date: startDateFormatted,
community: item.fields.community,
contentful: true, // flag to show its coming from contentful
};
});
// Write data to JSON file
const filePath = path.join(__dirname, '../static/JSON/contentful-events.json');
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
console.log('Data fetched and written to contentful-events.json');
} catch (error) {
console.error('Error fetching data from Contentful:', error);
process.exit(1);
}
}
fetchData();

View File

@@ -0,0 +1,15 @@
[
{
"name": "Testing Contentful Event",
"description": "Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar Lorem Ipsum Dolar ",
"type": "cc",
"link": "https://google.com",
"location": "Contentful, CA",
"date": "December 13, 2024 - January 9, 2025",
"image": "https://images.ctfassets.net/mixeai34z104/27BDYjXhNHFEc2g2LpU7pE/43b14752034af1e06e256a8fabfc5c91/SouthKoreaMeetup.png",
"end_date": "January 9, 2025",
"start_date": "December 13, 2024",
"community": true,
"contentful": true
}
]

1054
static/JSON/events.json Normal file

File diff suppressed because it is too large Load Diff