Skip to content

Commit

Permalink
fix profiles urls
Browse files Browse the repository at this point in the history
  • Loading branch information
blopa committed May 13, 2021
1 parent 609b827 commit 5b0a02e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ First of all you need to create a Google Spreadsheet following the same rules as
- **coverLetter:** Your cover letter template
- **__translation__:** Add your custom translations

###**Please make sure to [publish your Spreadsheet to the web](https://support.google.com/a/users/answer/9308870)**, otherwise it won't work.

## Libraries
- I'm using [gatsby.js](https://github.com/gatsbyjs/gatsby), [react.js](https://github.com/facebook/react), [js-xlsx](https://github.com/sheetjs/js-xlsx), [Material UI](https://material-ui.com/) and [mustache.js](https://github.com/janl/mustache.js/).
- Gatsby template from [gatsby-material-ui-blog-starter](https://github.com/blopa/gatsby-material-ui-blog-starter)
Expand Down Expand Up @@ -303,6 +305,12 @@ The following `JSON` is a result of [this Google Spreadsheet](https://docs.googl
![ScreenShot](https://raw.githubusercontent.com/blopa/Resume-Builder/main/screenshots/v4/screenshot_3.png)

## Release Notes
- **v4.0.5:**
- Fix `profiles` not being parsed correctly from the Spreadsheet
- Fix parsing Google Spreadsheet (but you need to publish it to the web to work)
- **v4.0.4:**
- *Error 404: Release not found*
- Sorry I had to make this joke...
- **v4.0.3:**
- Add toggler for `keywords` and `highlights` on the sidebar.
- Bump Gatsby and plugins to 3.5.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "resume-builder",
"version": "4.0.3",
"version": "4.0.5",
"description": "Resume Builder",
"main": "index.js",
"author": "Pablo Pirata",
Expand Down
2 changes: 1 addition & 1 deletion resume.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"network": "Twitter",
"username": "neutralthoughts",
"url": ""
"url": "https://twitter.com/neutralthoughts"
},
{
"network": "SoundCloud",
Expand Down
8 changes: 6 additions & 2 deletions src/utils/spreadsheet-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export const downloadSpreadsheetFile =
xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.onload = (event) => {
if (event.currentTarget.status === 200) {
return readSpreadsheetData(xhr.responseText, callback);
if (xhr.responseText.startsWith('PK')) {
return readSpreadsheetData(xhr.responseText, callback);
}

return errorCallback(downloadUrl);
}

return errorCallback(downloadUrl);
Expand All @@ -58,7 +62,7 @@ export const parseSpreadsheetUrl =
}
const spreadsheetId = spreadsheetIdResult[1];

downloadSpreadsheetFile(spreadsheetId, sheetId, callback, errorCallback);
downloadSpreadsheetFile(spreadsheetId, sheetId, callback, errorCallback, false);
};

export const readSpreadsheet = (file, callback) => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/spreadsheet-to-json-resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ export default function spreadsheetToJsonResume(jsonSpreadsheet) {
.some((entry) => entry[1].enabled),
value: {
...jsonResume.basics.value,
profile: {
profiles: {
enabled: profileEnabled,
value: profilesArray,
},
Expand Down

0 comments on commit 5b0a02e

Please sign in to comment.