Commit 60ae2578 by PLN (Algolia)

feat: Resize, cloudinary

parent aeb8ed6e
// next.config.js // next.config.js
const withImages = require('next-images') module.exports = {
module.exports = withImages() images: {
domains: [
'res.cloudinary.com'
],
},
}
...@@ -56,9 +56,14 @@ export async function getStaticProps({ params }) { ...@@ -56,9 +56,14 @@ export async function getStaticProps({ params }) {
// Fix dimensions if really big picture // Fix dimensions if really big picture
console.log("Pic dims: ", pic.dimensions.width, pic.dimensions.height); console.log("Pic dims: ", pic.dimensions.width, pic.dimensions.height);
if (pic.dimensions.widths > 1000 || pic.dimensions.heigth > 1000) {
pic.dimensions.width /= 2;
pic.dimensions.height = 2;
console.log("Resized: ", pic.dimensions.width, pic.dimensions.height);
}
if (pic.dimensions.width > 1000 || pic.dimensions.heigth > 1000) { if (pic.dimensions.width > 1000 || pic.dimensions.heigth > 1000) {
pic.dimensions.width = pic.dimensions.width / 2; pic.dimensions.width /= 2;
pic.dimensions.heigth = pic.dimensions.heigth / 2; pic.dimensions.height /= 2;
console.log("Resized: ", pic.dimensions.width, pic.dimensions.height); console.log("Resized: ", pic.dimensions.width, pic.dimensions.height);
>>>>>>> 54109d5 (feat: Modulated Links) >>>>>>> 54109d5 (feat: Modulated Links)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment