Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang committed Aug 29, 2023
1 parent e51da50 commit acc1274
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions utils/get_file_author_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ const fileData = {};

for (const username in authorsData) {
const imageUrl = authorsData[username].avatar_url

// const { response: imgResponse, headers: respHeaders } = await httpsGet(imageUrl, options)

// const fileExt = respHeaders["content-type"].split("/")[1]
// const imgFilename = `./src/images/authors/${username}.${fileExt}`
// fs.writeFileSync(imgFilename, imgResponse)
const imgName = await downloadImage(imageUrl, username)
authorsData[username].image = imgName
}
Expand Down Expand Up @@ -165,9 +159,6 @@ const getAllFileData = (filepath) => {
};

function filePathToRoute(filePath) {
// Convert Windows-style path separators to Unix-style
// const normalizedPath = filePath.replace(/\\/g, "/");

const route = filePath
.replace(/(\/index)?\.[^.]+$/, "") // Remove the file extension and "index" suffix if present
.replace(/^.*\/pages\/?/, ""); // Remove the "pages" directory prefix and add a leading slash
Expand Down

0 comments on commit acc1274

Please sign in to comment.