Skip to content

Commit

Permalink
Merge pull request #642 from memser-spaceport/stage
Browse files Browse the repository at this point in the history
feat: Tina decomminssioning
  • Loading branch information
prasanth-ideas2it authored Sep 30, 2024
2 parents 6bed123 + 8317574 commit b45ed51
Show file tree
Hide file tree
Showing 383 changed files with 8,676 additions and 10,838 deletions.
7 changes: 0 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
# These are retrieved from your project at app.tina.io
NEXT_PUBLIC_TINA_CLIENT_ID=***
TINA_TOKEN=***

# This is set by default CI with Netlify/Vercel/Github, but can be overriden
NEXT_PUBLIC_TINA_BRANCH=***

#Token to retrieve announcement
NEXT_PUBLIC_ANNOUNCEMENT_API_TOKEN=
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "daily"
allow:
- dependency-name: "tinacms"
- dependency-name: "@tinacms*"
# allow:
# - dependency-name: "tinacms"
# - dependency-name: "@tinacms*"
4 changes: 0 additions & 4 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Build Pull request
on:
pull_request:
types: [opened, synchronize, reopened]
env:
NEXT_PUBLIC_TINA_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_TINA_CLIENT_ID }}
TINA_TOKEN: ${{ secrets.TINA_TOKEN }}
NEXT_PUBLIC_TINA_BRANCH: ${{ github.head_ref }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down
12 changes: 0 additions & 12 deletions .tina/__generated__/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .tina/__generated__/_graphql.json

This file was deleted.

1 change: 0 additions & 1 deletion .tina/__generated__/_lookup.json

This file was deleted.

1 change: 0 additions & 1 deletion .tina/__generated__/_schema.json

This file was deleted.

204 changes: 0 additions & 204 deletions .tina/__generated__/config.prebuild.jsx

This file was deleted.

1 change: 0 additions & 1 deletion .tina/__generated__/static-media.json

This file was deleted.

29 changes: 0 additions & 29 deletions .tina/config.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions NOTICE

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# PL network events
This website is a listing of events happening within the Protocol Labs.
# PL events
This website is a listing of events happening within Protocol Labs.

## Submitting Events
We encourage you to submit your events to this site via a pull request on github, to do so...

1. Please download a copy of the template from the path: ```eventTemplate/template_short_event.txt```
2. Using the template please fill details related to your event and rename the file as ```<your-event-name>.md```
3. Place the finished file in the path as mentioned: ```/content/events/<your-event-name>.md```
2. Using the template please fill details related to your event and rename the file as ```<your-event-name>.json```
3. Place the finished file in the path as mentioned: ```/content/events/<your-event-name>.json```
4. Create a PR to this repo to add this new file
5. The Member Services team will review and merge your event into the website

Expand All @@ -16,7 +16,7 @@ Start date & end date are required to display the event on the timeline.
If you don't have concrete dates, add the approximate dates & set ```dateTBD: true```.

## Editing Events
If you've already created your event but want to add or change details in the .md file, create a PR with your edit requests, along with any comments. The Spaceport team will review and merge your changes to the website.
If you've already created your event but want to add or change details in the .json file, create a PR with your edit requests, along with any comments. The Spaceport team will review and merge your changes to the website.

# Developers
This is a [Microgen](https://github.com/pathfindertools/microgen) site.
Expand Down
32 changes: 32 additions & 0 deletions app/api/eventjson/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NextRequest } from "next/server";
import fs from "fs";
import path from "path";

function readJsonFiles() {
const folderPath = path.join(process.cwd(), "content/events"); // Get the absolute path to the folder
const fileNames = fs.readdirSync(folderPath); // Read all file names in the folder

// Filter JSON files and read their contents
const jsonData = fileNames
.filter((file) => file.endsWith(".json")) // Filter only JSON files
.map((file) => {
const filePath = path.join(folderPath, file); // Get the absolute path to the file
const fileContent = fs.readFileSync(filePath, "utf8"); // Read the file contents
return JSON.parse(fileContent); // Parse JSON and return the data
});

return jsonData;
}
export async function GET(request: NextRequest) {
try {
// const eventsListData = await client.queries.eventConnection({ last: -1 });
// const events = eventsListData?.data?.eventConnection?.edges ?? [];
// return Response.json({ data: events }, { status: 200 });
const jsonData = readJsonFiles(); // Call the utility function with your folder path
return Response.json({ data: jsonData }, { status: 200 });
} catch (error) {
console.error(error);
return Response.json({ message: "Internal Server Error" }, { status: 500 });
}
}

Loading

0 comments on commit b45ed51

Please sign in to comment.