Skip to content

Commit

Permalink
Merge pull request #28 from uclaacm/elizabeth
Browse files Browse the repository at this point in the history
Component backend
  • Loading branch information
ArshMalik02 authored Sep 4, 2023
2 parents 2244eab + ab28fef commit bbc5e12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
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,
};

0 comments on commit bbc5e12

Please sign in to comment.