Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { resumeSections } from 'https://esm.town/v/iamseeley/resumeSections';
import { oceanTheme } from 'https://esm.town/v/iamseeley/oceanTheme';
export async function resumeSetup(resumeConfig) {
const {
resumeJsonUrl,
resumeJson,
theme,
customStyleUrl,
sectionOrder,
customSections,
savePDFIsVisible
} = resumeConfig;
let resumeDetails = resumeJson;
try {
if (resumeJsonUrl) {
const response = await fetch(resumeJsonUrl);
if (!response.ok) {
throw new Error(`Failed to fetch resume details from URL: ${response.statusText}`);
}
resumeDetails = await response.json();
}
} catch (error) {
console.error(`Error fetching resume data: ${error.message}`);
}
const mergedSections = {
...resumeSections,
...customSections
};
const isOceanTheme = theme === oceanTheme;
return {
resumeDetails,
theme,
customStyleUrl,
sectionOrder,
sections: mergedSections,
savePDFIsVisible,
isOceanTheme
};
}
August 15, 2024