3:I[5613,[],""] 5:I[1778,[],""] 6:I[8029,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],"ThemeProviders"] 7:I[5935,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],""] 8:I[8251,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],"KBarSearchProvider"] 9:I[5250,["250","static/chunks/250-c212f27b438f85e4.js","749","static/chunks/749-ab6226b30b72a67a.js","797","static/chunks/app/blog/%5B...slug%5D/page-ff7d388b83cc9d76.js"],""] a:I[7005,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],"KBarButton"] b:I[5021,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],""] c:I[6422,["250","static/chunks/250-c212f27b438f85e4.js","578","static/chunks/578-f65e36f4042c75b9.js","185","static/chunks/app/layout-7b5289faaafa605a.js"],""] 4:["slug","guide-to-using-images-in-nextjs","c"] 0:["a-MUoAQ5MZU5SLpXDyOXy",[[["",{"children":["blog",{"children":[["slug","guide-to-using-images-in-nextjs","c"],{"children":["__PAGE__?{\"slug\":[\"guide-to-using-images-in-nextjs\"]}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["slug","guide-to-using-images-in-nextjs","c"],{"children":["__PAGE__",{},["$L1","$L2",null]]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/c1c99bc127b9f571.css","precedence":"next","crossOrigin":""}]]}]]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","html",null,{"lang":"en-us","className":"__variable_641c3b scroll-smooth","suppressHydrationWarning":true,"children":[["$","link",null,{"rel":"apple-touch-icon","sizes":"76x76","href":"/static/favicons/apple-touch-icon.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"32x32","href":"/static/favicons/favicon-32x32.png"}],["$","link",null,{"rel":"icon","type":"image/png","sizes":"16x16","href":"/static/favicons/favicon-16x16.png"}],["$","link",null,{"rel":"manifest","href":"/static/favicons/site.webmanifest"}],["$","link",null,{"rel":"mask-icon","href":"/static/favicons/safari-pinned-tab.svg","color":"#5bbad5"}],["$","meta",null,{"name":"msapplication-TileColor","content":"#000000"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: light)","content":"#fff"}],["$","meta",null,{"name":"theme-color","media":"(prefers-color-scheme: dark)","content":"#000"}],["$","link",null,{"rel":"alternate","type":"application/rss+xml","href":"/feed.xml"}],["$","body",null,{"className":"bg-white text-black antialiased dark:bg-gray-950 dark:text-white","children":["$","$L6",null,{"children":[["$undefined","$undefined","$undefined",["$","$L7",null,{"async":true,"defer":true,"data-website-id":"eb7a6ee1-bb6e-4122-aead-a7ddbf0194e1","src":"https://analytics.umami.is/script.js"}],"$undefined"],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":["$","div",null,{"className":"flex h-screen flex-col justify-between font-sans","children":[["$","$L8",null,{"kbarConfig":{"searchDocumentsPath":"search.json"},"children":[["$","header",null,{"className":"flex items-center justify-between py-10","children":[["$","div",null,{"children":["$","$L9",null,{"href":"/","aria-label":"初心者博客","children":["$","div",null,{"className":"flex items-center justify-between","children":[["$","div",null,{"className":"mr-3","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","xmlnsXlink":"http://www.w3.org/1999/xlink","width":53.87,"height":43.61,"viewBox":"344.564 330.278 111.737 91.218","children":[["$","defs",null,{"children":[["$","linearGradient",null,{"id":"logo_svg__b","x1":420.97,"x2":420.97,"y1":331.28,"y2":418.5,"gradientUnits":"userSpaceOnUse","children":[["$","stop",null,{"offset":"0%","style":{"stopColor":"#06b6d4","stopOpacity":1}}],["$","stop",null,{"offset":"100%","style":{"stopColor":"#67e8f9","stopOpacity":1}}]]}],["$","linearGradient",null,{"id":"logo_svg__d","x1":377.89,"x2":377.89,"y1":331.28,"y2":418.5,"gradientUnits":"userSpaceOnUse","children":[["$","stop",null,{"offset":"0%","style":{"stopColor":"#06b6d4","stopOpacity":1}}],["$","stop",null,{"offset":"100%","style":{"stopColor":"#67e8f9","stopOpacity":1}}]]}],["$","path",null,{"id":"logo_svg__a","d":"M453.3 331.28v28.57l-64.66 58.65v-30.08z"}],["$","path",null,{"id":"logo_svg__c","d":"M410.23 331.28v28.57l-64.67 58.65v-30.08z"}]]}],["$","use",null,{"xlinkHref":"#logo_svg__a","fill":"url(#logo_svg__b)"}],["$","use",null,{"xlinkHref":"#logo_svg__c","fill":"url(#logo_svg__d)"}]]}]}],["$","div",null,{"className":"hidden h-6 text-2xl font-semibold sm:block","children":"初心者博客"}]]}]}]}],["$","div",null,{"className":"flex items-center space-x-4 leading-5 sm:space-x-6","children":[[["$","$L9",null,{"href":"/blog","className":"hidden font-medium text-gray-900 dark:text-gray-100 sm:block","children":"Blog"}],["$","$L9",null,{"href":"/tags","className":"hidden font-medium text-gray-900 dark:text-gray-100 sm:block","children":"Tags"}],["$","$L9",null,{"href":"/about","className":"hidden font-medium text-gray-900 dark:text-gray-100 sm:block","children":"About"}]],["$","$La",null,{"aria-label":"Search","children":["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24","strokeWidth":1.5,"stroke":"currentColor","className":"h-6 w-6 text-gray-900 dark:text-gray-100","children":["$","path",null,{"strokeLinecap":"round","strokeLinejoin":"round","d":"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"}]}]}],["$","$Lb",null,{}],["$","$Lc",null,{}]]}]]}],["$","main",null,{"className":"mb-auto","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":["$","div",null,{"className":"flex flex-col items-start justify-start md:mt-24 md:flex-row md:items-center md:justify-center md:space-x-6","children":[["$","div",null,{"className":"space-x-2 pb-8 pt-6 md:space-y-5","children":["$","h1",null,{"className":"text-6xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 md:border-r-2 md:px-6 md:text-8xl md:leading-14","children":"404"}]}],["$","div",null,{"className":"max-w-md","children":[["$","p",null,{"className":"mb-4 text-xl font-bold leading-normal md:text-2xl","children":"Sorry we couldn't find this page."}],["$","p",null,{"className":"mb-8","children":"But dont worry, you can find plenty of other things on our homepage."}],["$","$L9",null,{"href":"/","className":"focus:shadow-outline-blue inline rounded-lg border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium leading-5 text-white shadow transition-colors duration-150 hover:bg-blue-700 focus:outline-none dark:hover:bg-blue-500","children":"Back to homepage"}]]}]]}],"notFoundStyles":[],"styles":null}]}]]}],["$","footer",null,{"children":["$","div",null,{"className":"mt-16 flex flex-col items-center","children":[["$","div",null,{"className":"mb-3 flex space-x-4","children":[["$","a",null,{"className":"text-sm text-gray-500 transition hover:text-gray-600","target":"_blank","rel":"noopener noreferrer","href":"mailto:antipathyworld@yok1.eu.org","children":[["$","span",null,{"className":"sr-only","children":"mail"}],["$","svg",null,{"xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 20 20","className":"fill-current text-gray-700 hover:text-primary-500 dark:text-gray-200 dark:hover:text-primary-400 h-6 w-6","children":[["$","path",null,{"d":"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z"}],["$","path",null,{"d":"M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z"}]]}]]}],null,null,null,null,null,null,null]}],["$","div",null,{"className":"mb-2 flex space-x-2 text-sm text-gray-500 dark:text-gray-400","children":[["$","div",null,{"children":"假花"}],["$","div",null,{"children":" • "}],["$","div",null,{"children":"© 2024"}],["$","div",null,{"children":" • "}],["$","$L9",null,{"href":"/","children":"ANTIPATHY WORLD"}]]}],["$","div",null,{"className":"mb-8 text-sm text-gray-500 dark:text-gray-400","children":["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://github.com/timlrx/tailwind-nextjs-starter-blog","children":"Tailwind Nextjs Theme"}]}]]}]}]]}]}]]}]}]]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/de0cb273fec7029e.css","precedence":"next","crossOrigin":""}]],"$Ld"]]]] e:I[144,["250","static/chunks/250-c212f27b438f85e4.js","749","static/chunks/749-ab6226b30b72a67a.js","797","static/chunks/app/blog/%5B...slug%5D/page-ff7d388b83cc9d76.js"],""] f:I[1749,["250","static/chunks/250-c212f27b438f85e4.js","749","static/chunks/749-ab6226b30b72a67a.js","797","static/chunks/app/blog/%5B...slug%5D/page-ff7d388b83cc9d76.js"],"Image"] 10:I[2529,["250","static/chunks/250-c212f27b438f85e4.js","749","static/chunks/749-ab6226b30b72a67a.js","797","static/chunks/app/blog/%5B...slug%5D/page-ff7d388b83cc9d76.js"],""] 11:I[8799,["250","static/chunks/250-c212f27b438f85e4.js","749","static/chunks/749-ab6226b30b72a67a.js","797","static/chunks/app/blog/%5B...slug%5D/page-ff7d388b83cc9d76.js"],""] 2:[["$","script",null,{"type":"application/ld+json","dangerouslySetInnerHTML":{"__html":"{\"@context\":\"https://schema.org\",\"@type\":\"BlogPosting\",\"headline\":\"Images in Next.js\",\"datePublished\":\"2020-11-11T00:00:00.000Z\",\"dateModified\":\"2020-11-11T00:00:00.000Z\",\"description\":\"In this article we introduce adding images in the tailwind starter blog and the benefits and limitations of the next/image component.\",\"image\":\"/static/images/twitter-card.png\",\"url\":\"https://yok1.eu.org/blog/guide-to-using-images-in-nextjs\",\"author\":[{\"@type\":\"Person\",\"name\":\"Sparrow Hawk\"}]}"}}],["$","section",null,{"className":"mx-auto max-w-3xl px-4 sm:px-6 xl:max-w-5xl xl:px-0","children":[["$","$Le",null,{}],["$","article",null,{"children":["$","div",null,{"className":"xl:divide-y xl:divide-gray-200 xl:dark:divide-gray-700","children":[["$","header",null,{"className":"pt-6 xl:pb-6","children":["$","div",null,{"className":"space-y-1 text-center","children":[["$","dl",null,{"className":"space-y-10","children":["$","div",null,{"children":[["$","dt",null,{"className":"sr-only","children":"Published on"}],["$","dd",null,{"className":"text-base font-medium leading-6 text-gray-500 dark:text-gray-400","children":["$","time",null,{"dateTime":"2020-11-11T00:00:00.000Z","children":"Wednesday, November 11, 2020"}]}]]}]}],["$","div",null,{"children":["$","h1",null,{"className":"text-3xl font-extrabold leading-9 tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 md:text-5xl md:leading-14","children":"Images in Next.js"}]}]]}]}],["$","div",null,{"className":"grid-rows-[auto_1fr] divide-y divide-gray-200 pb-8 dark:divide-gray-700 xl:grid xl:grid-cols-4 xl:gap-x-6 xl:divide-y-0","children":[["$","dl",null,{"className":"pb-10 pt-6 xl:border-b xl:border-gray-200 xl:pt-11 xl:dark:border-gray-700","children":[["$","dt",null,{"className":"sr-only","children":"Authors"}],["$","dd",null,{"children":["$","ul",null,{"className":"flex flex-wrap justify-center gap-4 sm:space-x-12 xl:block xl:space-x-0 xl:space-y-8","children":[["$","li","Sparrow Hawk",{"className":"flex items-center space-x-2","children":[["$","$Lf",null,{"src":"/static/images/sparrowhawk-avatar.jpg","width":38,"height":38,"alt":"avatar","className":"h-10 w-10 rounded-full"}],["$","dl",null,{"className":"whitespace-nowrap text-sm font-medium leading-5","children":[["$","dt",null,{"className":"sr-only","children":"Name"}],["$","dd",null,{"className":"text-gray-900 dark:text-gray-100","children":"Sparrow Hawk"}],["$","dt",null,{"className":"sr-only","children":"Twitter"}],["$","dd",null,{"children":["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://twitter.com/sparrowhawk","className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":"@sparrowhawk"}]}]]}]]}]]}]}]]}],["$","div",null,{"className":"divide-y divide-gray-200 dark:divide-gray-700 xl:col-span-3 xl:row-span-2 xl:pb-0","children":[["$","div",null,{"className":"prose max-w-none pb-8 pt-10 dark:prose-invert","children":[["$","h1",null,{"id":"introduction","children":[["$","a",null,{"href":"#introduction","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Introduction"]}],["$","p",null,{"children":["The tailwind starter blog has out of the box support for ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://nextjs.org/docs/api-reference/next/image","children":"Next.js's built-in image component"}]," and automatically swaps out default image tags in markdown or mdx documents to use the Image component provided."]}],["$","h1",null,{"id":"usage","children":[["$","a",null,{"href":"#usage","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Usage"]}],["$","p",null,{"children":"To use in a new page route / javascript file, simply import the image component and call it e.g."}],["$","$L10",null,{"className":"language-js","children":["$","code",null,{"className":"language-js code-highlight","children":[["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword module","children":"import"}]," ",["$","span",null,{"className":"token imports","children":["$","span",null,{"className":"token maybe-class-name","children":"Image"}]}]," ",["$","span",null,{"className":"token keyword module","children":"from"}]," ",["$","span",null,{"className":"token string","children":"'next/image'"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword","children":"function"}]," ",["$","span",null,{"className":"token function","children":["$","span",null,{"className":"token maybe-class-name","children":"Home"}]}],["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token punctuation","children":")"}]," ",["$","span",null,{"className":"token punctuation","children":"{"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token keyword control-flow","children":"return"}]," ",["$","span",null,{"className":"token punctuation","children":"("}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"h1",["$","span",null,{"className":"token operator","children":">"}],["$","span",null,{"className":"token maybe-class-name","children":"My"}]," ",["$","span",null,{"className":"token maybe-class-name","children":"Homepage"}],["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token operator","children":"/"}],"h1",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token maybe-class-name","children":"Image"}]," src",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token string","children":"\"/me.png\""}]," alt",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token string","children":"\"Picture of the author\""}]," width",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token punctuation","children":"{"}],["$","span",null,{"className":"token number","children":"500"}],["$","span",null,{"className":"token punctuation","children":"}"}]," height",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token punctuation","children":"{"}],["$","span",null,{"className":"token number","children":"500"}],["$","span",null,{"className":"token punctuation","children":"}"}]," ",["$","span",null,{"className":"token operator","children":"/"}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],"p",["$","span",null,{"className":"token operator","children":">"}],["$","span",null,{"className":"token maybe-class-name","children":"Welcome"}]," to my homepage",["$","span",null,{"className":"token operator","children":"!"}],["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token operator","children":"/"}],"p",["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token operator","children":"/"}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}],["$","span",null,{"className":"code-line","children":[" ",["$","span",null,{"className":"token punctuation","children":")"}],"\n"]}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token punctuation","children":"}"}],"\n"]}],["$","span",null,{"className":"code-line","children":"\n"}],["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token keyword module","children":"export"}]," ",["$","span",null,{"className":"token keyword module","children":"default"}]," ",["$","span",null,{"className":"token maybe-class-name","children":"Home"}],"\n"]}]]}]}],["$","p",null,{"children":["For a markdown file, the default image tag can be used and the default ",["$","code",null,{"children":"img"}]," tag gets replaced by the ",["$","code",null,{"children":"Image"}]," component in the build process."]}],["$","p",null,{"children":["Assuming we have a file called ",["$","code",null,{"children":"ocean.jpg"}]," in ",["$","code",null,{"children":"data/img/ocean.jpg"}],", the following line of code would generate the optimized image."]}],["$","$L10",null,{"className":"language-js","children":["$","code",null,{"className":"language-js code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token operator","children":"!"}],["$","span",null,{"className":"token punctuation","children":"["}],"ocean",["$","span",null,{"className":"token punctuation","children":"]"}],["$","span",null,{"className":"token punctuation","children":"("}],["$","span",null,{"className":"token operator","children":"/"}],["$","span",null,{"className":"token keyword","children":"static"}],["$","span",null,{"className":"token operator","children":"/"}],"images",["$","span",null,{"className":"token operator","children":"/"}],"ocean",["$","span",null,{"className":"token punctuation","children":"."}],["$","span",null,{"className":"token property-access","children":"jpg"}],["$","span",null,{"className":"token punctuation","children":")"}],"\n"]}]}]}],["$","p",null,{"children":["Alternatively, since we are using mdx, we can just use the image component directly! Note, that you would have to provide a fixed width and height. The ",["$","code",null,{"children":"img"}]," tag method parses the dimension automatically."]}],["$","$L10",null,{"className":"language-js","children":["$","code",null,{"className":"language-js code-highlight","children":["$","span",null,{"className":"code-line","children":[["$","span",null,{"className":"token operator","children":"<"}],["$","span",null,{"className":"token maybe-class-name","children":"Image"}]," alt",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token string","children":"\"ocean\""}]," src",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token string","children":"\"/static/images/ocean.jpg\""}]," width",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token punctuation","children":"{"}],["$","span",null,{"className":"token number","children":"256"}],["$","span",null,{"className":"token punctuation","children":"}"}]," height",["$","span",null,{"className":"token operator","children":"="}],["$","span",null,{"className":"token punctuation","children":"{"}],["$","span",null,{"className":"token number","children":"128"}],["$","span",null,{"className":"token punctuation","children":"}"}]," ",["$","span",null,{"className":"token operator","children":"/"}],["$","span",null,{"className":"token operator","children":">"}],"\n"]}]}]}],["$","p",null,{"children":[["$","em",null,{"children":"Note"}],": If you try to save the image, it is in webp format, if your browser supports it!"]}],["$","div",null,{"children":["$","$Lf",null,{"alt":"ocean","src":"/static/images/ocean.jpeg","width":"1920","height":"1280"}]}],["$","p",null,{"children":["Photo by ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://unsplash.com/@yucar?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText","children":"YUCAR FotoGrafik"}]," on ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://unsplash.com/s/photos/sea?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText","children":"Unsplash"}]]}],["$","h1",null,{"id":"benefits","children":[["$","a",null,{"href":"#benefits","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Benefits"]}],["$","ul",null,{"children":[["$","li",null,{"children":"Smaller image size with Webp (~30% smaller than jpeg)"}],["$","li",null,{"children":"Responsive images - the correct image size is served based on the user's viewport"}],["$","li",null,{"children":"Lazy loading - images load as they are scrolled to the viewport"}],["$","li",null,{"children":["Avoids ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://web.dev/cls/","children":"Cumulative Layout Shift"}]]}],["$","li",null,{"children":"Optimization on demand instead of build-time - no increase in build time!"}]]}],["$","h1",null,{"id":"limitations","children":[["$","a",null,{"href":"#limitations","aria-hidden":"true","tabIndex":"-1","children":["$","span",null,{"className":"icon icon-link"}]}],"Limitations"]}],["$","ul",null,{"children":[["$","li",null,{"children":[["$","p",null,{"children":["Due to the reliance on ",["$","code",null,{"children":"next/image"}],", unless you are using an external image CDN like Cloudinary or Imgix, it is practically required to use Vercel for hosting. This is because the component acts like a serverless function that calls a highly optimized image CDN."]}],["$","p",null,{"children":["If you do not want to be tied to Vercel, you can remove ",["$","code",null,{"children":"imgToJsx"}]," in ",["$","code",null,{"children":"remarkPlugins"}]," in ",["$","code",null,{"children":"lib/mdx.js"}],". This would avoid substituting the default ",["$","code",null,{"children":"img"}]," tag."]}],["$","p",null,{"children":["Alternatively, one could wait for image optimization at build time to be supported. A different library, ",["$","a",null,{"target":"_blank","rel":"noopener noreferrer","href":"https://github.com/cyrilwanner/next-optimized-images","children":"next-optimized-images"}]," does that, although it requires transforming the images through webpack which is not done here."]}]]}],["$","li",null,{"children":["$","p",null,{"children":["Images from external links are not passed through ",["$","code",null,{"children":"next/image"}]]}]}],["$","li",null,{"children":["$","p",null,{"children":["All images have to be stored in the ",["$","code",null,{"children":"public"}]," folder e.g ",["$","code",null,{"children":"/static/images/ocean.jpeg"}]]}]}]]}]]}],["$","div",null,{"className":"pb-6 pt-6 text-sm text-gray-700 dark:text-gray-300","children":[["$","a",null,{"target":"_blank","rel":"nofollow","href":"https://mobile.twitter.com/search?q=https%3A%2F%2Fyok1.eu.org%2Fblog%2Fguide-to-using-images-in-nextjs","children":"Discuss on Twitter"}]," • ",["$","$L9",null,{"href":"/blob/main/data/blog/guide-to-using-images-in-nextjs.mdx","children":"View on GitHub"}]]}],["$","div",null,{"className":"pb-6 pt-6 text-center text-gray-700 dark:text-gray-300","id":"comment","children":["$","$L11",null,{"slug":"guide-to-using-images-in-nextjs"}]}]]}],["$","footer",null,{"children":[["$","div",null,{"className":"divide-gray-200 text-sm font-medium leading-5 dark:divide-gray-700 xl:col-start-1 xl:row-start-2 xl:divide-y","children":[["$","div",null,{"className":"py-4 xl:py-8","children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Tags"}],["$","div",null,{"className":"flex flex-wrap","children":[["$","$L9",null,{"href":"/tags/next-js","className":"mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":"next-js"}],["$","$L9",null,{"href":"/tags/guide","className":"mr-3 text-sm font-medium uppercase text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":"guide"}]]}]]}],["$","div",null,{"className":"flex justify-between py-4 xl:block xl:space-y-8 xl:py-8","children":[["$","div",null,{"children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Previous Article"}],["$","div",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":["$","$L9",null,{"href":"/blog/github-markdown-guide","children":"Markdown Guide"}]}]]}],["$","div",null,{"children":[["$","h2",null,{"className":"text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400","children":"Next Article"}],["$","div",null,{"className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","children":["$","$L9",null,{"href":"/blog/deriving-ols-estimator","children":"Deriving the OLS Estimator"}]}]]}]]}]]}],["$","div",null,{"className":"pt-4 xl:pt-8","children":["$","$L9",null,{"href":"/blog","className":"text-primary-500 hover:text-primary-600 dark:hover:text-primary-400","aria-label":"Back to the blog","children":"← Back to the blog"}]}]]}]]}]]}]}]]}]] d:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Images in Next.js | ANTIPATHY WORLD"}],["$","meta","3",{"name":"description","content":"In this article we introduce adding images in the tailwind starter blog and the benefits and limitations of the next/image component."}],["$","meta","4",{"name":"robots","content":"index, follow"}],["$","meta","5",{"name":"googlebot","content":"index, follow, max-video-preview:-1, max-image-preview:large, max-snippet:-1"}],["$","link","6",{"rel":"canonical","href":"https://yok1.eu.org/blog/guide-to-using-images-in-nextjs"}],["$","link","7",{"rel":"alternate","type":"application/rss+xml","href":"https://yok1.eu.org/feed.xml"}],["$","meta","8",{"property":"og:title","content":"Images in Next.js"}],["$","meta","9",{"property":"og:description","content":"In this article we introduce adding images in the tailwind starter blog and the benefits and limitations of the next/image component."}],["$","meta","10",{"property":"og:url","content":"https://yok1.eu.org/blog/guide-to-using-images-in-nextjs"}],["$","meta","11",{"property":"og:site_name","content":"ANTIPATHY WORLD"}],["$","meta","12",{"property":"og:locale","content":"en_US"}],["$","meta","13",{"property":"og:image","content":"https://yok1.eu.org/static/images/twitter-card.png"}],["$","meta","14",{"property":"og:type","content":"article"}],["$","meta","15",{"property":"article:published_time","content":"2020-11-11T00:00:00.000Z"}],["$","meta","16",{"property":"article:modified_time","content":"2020-11-11T00:00:00.000Z"}],["$","meta","17",{"property":"article:author","content":"Sparrow Hawk"}],["$","meta","18",{"name":"twitter:card","content":"summary_large_image"}],["$","meta","19",{"name":"twitter:title","content":"Images in Next.js"}],["$","meta","20",{"name":"twitter:description","content":"In this article we introduce adding images in the tailwind starter blog and the benefits and limitations of the next/image component."}],["$","meta","21",{"name":"twitter:image","content":"https://yok1.eu.org/static/images/twitter-card.png"}],["$","meta","22",{"name":"next-size-adjust"}]] 1:null