Skip to content

Commit

Permalink
Hardcode my URL, remove _redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Nov 30, 2020
1 parent a547bfc commit 422961f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 205 deletions.
190 changes: 0 additions & 190 deletions _redirects

This file was deleted.

18 changes: 3 additions & 15 deletions node-avatars-opencollective.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,22 @@ async function fetch(name, imageUrl, website) {
let promises = [];
let avatarPaths = {};

// Deprecated
let redirects = [
"# Careful! This file is generated by node-avatars-opencollective.js for runtime JS for Eleventy Contributor Account avatars",
"# You can add manual entries to the netlify.toml file",
];

let getOpenCollectiveData = require("./_data/opencollective");
let opencollective = await getOpenCollectiveData();
for(let supporter of opencollective.supporters) {
// / https://levelup-styleguide.netlify.com/ 200!
promises.push(fetch(supporter.name, supporter.image, supporter.website));
}
}
// hardcode me
promises.push(fetch("Zach Leatherman", "https://unavatar.now.sh/twitter/zachleat", "https://www.zachleat.com/"));

let all = await Promise.all(promises);
for(let stats of all) {
if(stats) {
avatarPaths[stats.slug] = stats.jpeg[0].url;

// Deprecated
redirects.push(`/img/avatars/opencollective/${stats.slug}.jpg ${stats.jpeg[0].url} 200!`);
}
}

let avatarMapPath = "./functions/utils/avatarmap.json";
await fs.writeFile(avatarMapPath, JSON.stringify(avatarPaths, null, 2));
console.log( "Wrote", avatarMapPath );

// Deprecated
await fs.writeFile("./_redirects", redirects.join("\n"));
console.log( "Wrote _redirects" );
})();

0 comments on commit 422961f

Please sign in to comment.