Skip to content

Properly reference the jobs which are now on Ashby #146

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

Merged
merged 1 commit into from
Jun 2, 2025
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
23 changes: 11 additions & 12 deletions assets/js/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*
* With that disclaimer out of the way...
*
* This file handles the fetching of jobs from Lever such that they can be
* This file handles the fetching of jobs from Lever^WAshby such that they can be
* dynamically inserted into different parts of the tech blog
*/

/*
* This API will return an list of departments which must then be filtered
* through to find the .postings under each
*/
const API_URL = 'https://api.lever.co/v0/postings/scribd?group=department&mode=json'
const API_URL = 'https://api.ashbyhq.com/posting-api/job-board/scribd?includeCompensation=true'


/*
Expand All @@ -37,21 +37,20 @@ function fetchJobs() {

return fetch(API_URL)
.then(async (response) => {
const departments = await response.json();
const board = await response.json();
/*
* Since this is the tech blog, we're only pulling a couple of
* departments
*/
departments
.filter(d => ['Engineering', 'Data Science', 'Design', 'Business Analytics', 'Product'].includes(d.title))
.forEach((department) => {
department.postings.forEach((posting) => {
const team = posting.categories.team;
board.jobs
.filter(j => ['Engineering', 'Product, Design, & Analytics', 'Product'].includes(j.department))
.filter(j => !j.title.toLowerCase().includes('marketing'))
.forEach((job) => {
const team = job.team;
if (!window.jobsCache[team]) {
window.jobsCache[team] = [];
}
window.jobsCache[team].push(posting);
});
window.jobsCache[team].push(job);
});
window.jobsFetched = true;
return window.jobsCache;
Expand Down Expand Up @@ -98,9 +97,9 @@ function renderJobs(elem, team, randomLimit) {
li.innerHTML = `
<div class="card__body">
<h5 class="mt-0 mb-1 clamp-2">
<a href="${job.hostedUrl}" target="_blank" class="stretched-link link-text-color">${job.text}</a>
<a href="${job.jobUrl}" target="_blank" class="stretched-link link-text-color">${job.title}</a>
</h5>
<p class="m-0 fs-md monospace text-truncate">${job.categories.location || ''}</p>
<p class="m-0 fs-md monospace text-truncate">${job.location || ''}</p>
</div>
`;
elem.appendChild(li);
Expand Down
8 changes: 4 additions & 4 deletions careers.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ <h3 class="mb-3">${team}
li.innerHTML = `
<div class="action-cell__body">
<h5 class="mb-1">
<a href="${job.hostedUrl}" target="_blank" class="action-cell__link">
${job.text}
<a href="${job.jobUrl}" target="_blank" class="action-cell__link">
${job.title}
<svg class="hidden-md-up fs-md svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-external' | relative_url }}"></use></svg>
</a>
</h5>
<p class="mb-0 fs-md text-truncate text-muted monospace">${job.categories.location || ''}</p>
<p class="mb-0 fs-md text-truncate text-muted monospace">${job.location || ''}</p>
</div>
<a href="${job.hostedUrl}" target="_blank" class="hidden-md-down btn btn-primary btn-icon-external" tabindex="-1" aria-hidden="true">View Job
<a href="${job.jobUrl}" target="_blank" class="hidden-md-down btn btn-primary btn-icon-external" tabindex="-1" aria-hidden="true">View Job
<svg class="svg-icon"><use xlink:href="{{ '/assets/images/icons/icon-sprite.svg#arrow-external' | relative_url }}"></use></svg>
</a>
`;
Expand Down