Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
Philippe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
Philippe
Commits
60ae2578
Commit
60ae2578
authored
Jun 14, 2021
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Resize, cloudinary
parent
aeb8ed6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
next.config.js
next.config.js
+7
-2
[id].js
pages/photos/[id].js
+7
-2
No files found.
next.config.js
View file @
60ae2578
// next.config.js
const
withImages
=
require
(
'next-images'
)
module
.
exports
=
withImages
()
module
.
exports
=
{
images
:
{
domains
:
[
'res.cloudinary.com'
],
},
}
pages/photos/[id].js
View file @
60ae2578
...
...
@@ -56,9 +56,14 @@ export async function getStaticProps({ params }) {
// Fix dimensions if really big picture
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
)
{
pic
.
dimensions
.
width
=
pic
.
dimensions
.
width
/
2
;
pic
.
dimensions
.
heig
th
=
pic
.
dimensions
.
heigth
/
2
;
pic
.
dimensions
.
width
/=
2
;
pic
.
dimensions
.
heig
ht
/=
2
;
console
.
log
(
"Resized: "
,
pic
.
dimensions
.
width
,
pic
.
dimensions
.
height
);
>>>>>>>
54109
d5
(
feat
:
Modulated
Links
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment