-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(front): complets cv collection page/route pattern, components, a…
- Loading branch information
Showing
23 changed files
with
399 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export { shapeAwardData } from './shapeAwardData.js'; | ||
export { shapeCertificationData } from './shapeCertificationData.js'; | ||
export { shapeClassificationData } from './shapeClassificationData.js'; | ||
export { shapeIndustryData } from './shapeIndustryData.js'; | ||
export { shapeOrganizationData } from './shapeOrganizationData.js'; | ||
export { shapePositionData } from './shapePositionData.js'; | ||
export { shapeProjectData } from './shapeProjectData.js'; | ||
export { shapeSkillData } from './shapeSkillData.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export async function shapeAwardData(data) { | ||
let award, | ||
slug, | ||
URL, | ||
date, | ||
summary, | ||
body, | ||
seo, | ||
positions, | ||
projects = false; | ||
|
||
award = { slug, URL, date, summary, body, seo, positions, projects } = | ||
data[0].attributes; | ||
|
||
var pageMeta = { | ||
...seo, | ||
type: 'website', | ||
metaTitle: seo?.metaTitle || award, | ||
}; | ||
|
||
/** | ||
* Isolates the `metaImage` object properties we care about | ||
*/ | ||
pageMeta.metaImage = pageMeta?.metaImage?.data?.attributes || false; | ||
|
||
return { | ||
award: { | ||
...award, | ||
}, | ||
pageMeta, | ||
}; | ||
} |
49 changes: 49 additions & 0 deletions
49
front/src/lib/_utils/shape-shifters/shapeCertificationData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export async function shapeCertificationData(data) { | ||
let certification, | ||
seo, | ||
name, | ||
hero, | ||
start, | ||
end, | ||
certificationSlug, | ||
summary, | ||
body, | ||
artifacts, | ||
skills, | ||
organizations, | ||
industries, | ||
awards = false; | ||
|
||
certification = { | ||
seo, | ||
name, | ||
hero, | ||
start, | ||
end, | ||
slug: certificationSlug, | ||
summary, | ||
body, | ||
artifacts, | ||
skills, | ||
organizations, | ||
industries, | ||
awards, | ||
} = data[0].attributes; | ||
|
||
var pageMeta = { | ||
...seo, | ||
type: 'website', | ||
metaTitle: seo?.metaTitle || name, | ||
}; | ||
|
||
/** | ||
* Isolates the `metaImage` object properties we care about | ||
*/ | ||
pageMeta.metaImage = | ||
pageMeta?.metaImage?.data?.attributes || hero?.data?.attributes || false; | ||
|
||
return { | ||
certification, | ||
pageMeta, | ||
}; | ||
} |
49 changes: 49 additions & 0 deletions
49
front/src/lib/_utils/shape-shifters/shapeClassificationData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
export async function shapeClassificationData(data) { | ||
let classification, | ||
seo, | ||
name, | ||
hero, | ||
start, | ||
end, | ||
classificationSlug, | ||
summary, | ||
body, | ||
artifacts, | ||
skills, | ||
organizations, | ||
industries, | ||
awards = false; | ||
|
||
classification = { | ||
seo, | ||
name, | ||
hero, | ||
start, | ||
end, | ||
slug: classificationSlug, | ||
summary, | ||
body, | ||
artifacts, | ||
skills, | ||
organizations, | ||
industries, | ||
awards, | ||
} = data[0].attributes; | ||
|
||
var pageMeta = { | ||
...seo, | ||
type: 'website', | ||
metaTitle: seo?.metaTitle || name, | ||
}; | ||
|
||
/** | ||
* Isolates the `metaImage` object properties we care about | ||
*/ | ||
pageMeta.metaImage = | ||
pageMeta?.metaImage?.data?.attributes || hero?.data?.attributes || false; | ||
|
||
return { | ||
classification, | ||
pageMeta, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export async function shapeIndustryData(data) { | ||
let industry, | ||
seo, | ||
industrySlug, | ||
summary, | ||
skills, | ||
organizations, | ||
positions, | ||
projects, | ||
body = false; | ||
|
||
industry = { | ||
seo, | ||
industrySlug, | ||
summary, | ||
skills, | ||
organizations, | ||
positions, | ||
projects, | ||
body, | ||
} = data[0].attributes; | ||
|
||
var pageMeta = { | ||
...seo, | ||
type: 'website', | ||
metaTitle: seo?.metaTitle || industry, | ||
}; | ||
|
||
/** | ||
* Isolates the `metaImage` object properties we care about | ||
*/ | ||
pageMeta.metaImage = pageMeta?.metaImage?.data?.attributes || false; | ||
|
||
return { | ||
industry, | ||
pageMeta, | ||
}; | ||
} |
40 changes: 40 additions & 0 deletions
40
front/src/lib/_utils/shape-shifters/shapeOrganizationData.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
export async function shapeOrganizationData([data]) { | ||
let organization, | ||
name, | ||
images, | ||
URL, | ||
summary, | ||
projects, | ||
positions, | ||
skills, | ||
body, | ||
seo = false; | ||
|
||
organization = { | ||
name, | ||
images, | ||
URL, | ||
summary, | ||
projects, | ||
positions, | ||
skills, | ||
body, | ||
} = data.attributes; | ||
|
||
var pageMeta = { | ||
...seo, | ||
type: 'website', | ||
metaTitle: seo?.metaTitle || name, | ||
}; | ||
|
||
pageMeta.metaImage = | ||
pageMeta?.metaImage?.data?.attributes || images?.data?.attributes || false; | ||
|
||
return { | ||
organization: { | ||
...organization, | ||
images: images?.data?.attributes || false, | ||
}, | ||
pageMeta, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<script> | ||
export let content; | ||
let { | ||
name, | ||
slug: classificationSlug, | ||
summary, | ||
skills: { data: skills }, | ||
seo, | ||
} = content.classification; | ||
</script> | ||
|
||
<h1>{name}</h1> | ||
{#if summary} | ||
<p>{summary}</p> | ||
{/if} | ||
|
||
<h1 class="collection-title">Trades</h1> | ||
|
||
<!-- TODO: each of these should be placed in a single component and passed the data, or just the collection name --> | ||
{#if skills.length} | ||
<h2>skills</h2> | ||
<ul class="collection-attributes"> | ||
{#each skills as { attributes: { skill, slug: skillSlug } }} | ||
<li class="attribute"> | ||
<a href="/cv/skill/{skillSlug}">{skill}</a> | ||
</li> | ||
{/each} | ||
</ul> | ||
{/if} |
Oops, something went wrong.