Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component backend #28

Merged
merged 5 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ To build the site with your committee-specific information, you will fill out tw
Next to $committee-color, please replace the sample color with the hex code of your committee's color, which will be the accent color for the overall site.
Next to $committee, please replace the sample text with your committee's name, spelled and capitalized properly, exactly how it appears on the Committee Info spreadsheet. (example: TeachLA, ICPC, W are all valid. teach la, Icpc, w are invalid.) We will be using this to properly scrape your committee's information, so it is super important that this variable is correctly set! Please contact Elizabeth Kim (`@elizabethkim11`) if you would like your committee's name to be reflected differently than how it appears on the spreadsheet.

You will also fill out another field for your committee name in the global-variables.js file, which is located in the scripts folder. (full path: ./scripts/global-variables.js) Replace the sample committee name in the string on line 1 with your committee's name. Please follow the same guidelines as above for the committee name input.

## Spreadsheet Image Guidelines

- All image links should be sharable google drive links, with access permissions set to "Anyone with the link."
- All images should be .png, .jpeg, .jpg files.
- All images should be .png or .jpg files.
- All headshots must be square cropped.
- Contact Elizabeth Kim (`@elizabethkim11`) to properly modify your design assets to suit the template's home page.

Expand Down
2 changes: 1 addition & 1 deletion public/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"committee":"TeachLA","name":"TeachLA","subtitle":"making coding accessible","description":"ACM Teach LA is great","logoLink":"https://drive.google.com/uc?export=download&id=19mgOEZ92Ye_VHY6rUDMDth6XYQ9nWLN5","dcLink":"google.com","igLink":"instagram.com/eliizabethkim","email":"[email protected]","favicon":"https://drive.google.com/file/d/1oAd4HxRhn4c2l4EFCJzoVXLuKDd-xHRJ/view?usp=sharing","backgroundImg":"https://drive.google.com/uc?export=download&id=19GvTskjsX4xlJ2Pf8CLeYpJZn9uNGohT"}]
[{"committee":"ICPC","name":"ICPC","subtitle":"testing testing","description":"icpc is so icpc","logoLink":"https://drive.google.com/uc?export=download&id=19mgOEZ92Ye_VHY6rUDMDth6XYQ9nWLN5","dcLink":"https://google.com","igLink":"https://instagram.com/eliizabethkim","email":"[email protected]","favicon":"https://drive.google.com/file/d/1oAd4HxRhn4c2l4EFCJzoVXLuKDd-xHRJ/view?usp=sharing","backgroundImg":"https://drive.google.com/uc?export=download&id=19GvTskjsX4xlJ2Pf8CLeYpJZn9uNGohT"}]
13 changes: 2 additions & 11 deletions scripts/component-generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs';
import dotenv from 'dotenv';
import { google } from 'googleapis';
import { getCssStringFromCommittee, generateCommittee } from './lib.mjs';
// import vars from '../styles/global_variables.module.scss';
import { committee } from './global-variables.js';

// .env config
dotenv.config({ path: '.env.local' });
Expand All @@ -28,15 +28,6 @@ async function getComponentInfo(name) {
continue;
}
try {
// if (row[4] && row[4].includes('drive.google.com')) {
// const match = row[4].match(/\/file\/d\/([^/]+)\/?/);
// if (match) {
// const fileID = match[1];
// row[4] = `https://drive.google.com/uc?export=download&id=${fileID}`;
// } else {
// console.error(`Invalid Google Drive link format: ${row[4]}`);
// }
// }
const committeeData = generateCommittee({
committee: row[0],
name: row[1],
Expand Down Expand Up @@ -107,7 +98,7 @@ async function getGoogleSheetData(range) {
return rows;
}

getComponentInfo('TeachLA')
getComponentInfo(committee)
.then((committee) => {
// Process the committee data or perform any other actions
console.log(committee);
Expand Down
4 changes: 4 additions & 0 deletions scripts/global-variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const committee = 'ICPC';
module.exports = {
committee: committee,
};