1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[610],{516:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog/[id]",function(){return r(2272)}])},6869:function(e,t,r){"use strict";var i=r(5893),a=r(1664),s=r.n(a),n=r(5675),o=r.n(n),l=r(120);t.Z=function(e){var t=e.posts,r=e.theme;return(0,i.jsx)(i.Fragment,{children:t.map(function(e){var t;return(0,i.jsxs)("article",{className:"post ".concat(r),children:[(0,i.jsx)(s(),{href:"/blog/".concat(e.slug),children:(0,i.jsx)(o(),{src:"/images/".concat(e.data.previewImage,".webp"),alt:e.data.title,width:"358",height:"188",style:{height:"auto",width:"100%"},sizes:"(max-width: 600px) 100vw, (max-width: 1400px) 50vw, 33vw",className:"full-width",priority:!0})}),(0,i.jsxs)("div",{className:"preview",children:[(0,i.jsx)(s(),{href:"/blog/".concat(e.slug),children:(0,i.jsx)("h3",{children:e.data.title})}),(0,i.jsxs)("div",{className:"postDetails",children:[(0,i.jsx)(o(),{src:"/images/luke-anderson.webp",alt:"Luke Anderson",width:"40",height:"40",priority:!0,className:"authorImage"}),(0,i.jsx)("h4",{className:"authorName",children:"Luke Anderson"}),(0,i.jsx)("h4",{className:"publishedDate",children:(t=e.data.date,l.ou.fromISO(t).setLocale("en-GB").toLocaleString(l.ou.DATE_FULL))})]}),(0,i.jsx)("p",{children:e.data.preview}),(0,i.jsx)(s(),{href:"/blog/".concat(e.slug),children:"Read post"})]})]},e.slug)})})}},7562:function(e,t,r){"use strict";r.d(t,{Z:function(){return v}});var i=r(7568),a=r(4924),s=r(6042),n=r(9396),o=r(603),l=r(655),c=r(5893),d=r(7294),m=function(e){var t=(0,o.Z)((0,d.useState)({email:{dirty:!1,error:!1,message:""}}),2),r=t[0],i=t[1],l=function(e){var t=e.form,r=e.field,a=e.errors,l=e.forceTouchErrors,c=!0,d=JSON.parse(JSON.stringify(a));void 0!==l&&l&&(d=Object.entries(a).reduce(function(e,t){var r=(0,o.Z)(t,2),i=r[0],a=r[1];return e[i]=(0,n.Z)((0,s.Z)({},a),{dirty:!0}),e},{}));var m=t.email;if(d.email.dirty&&(!r||"email"===r)){var u=m?RegExp(/\S+@\S+\.\S+/).test(m)?"":"Incorrect email format":"Email is required";d.email.error=!!u,d.email.message=u,u&&(c=!1)}return i(d),{isValid:c,errors:d}};return{validateForm:l,onBlurField:function(t){var i=t.target.name;if(!r[i].dirty){var o=(0,n.Z)((0,s.Z)({},r),(0,a.Z)({},i,(0,n.Z)((0,s.Z)({},r[i]),{dirty:!0})));l({form:e,field:i,errors:o})}},errors:r}},u=r(5675),p=r.n(u),h=r(6010),g=r(4603),f=r.n(g),x=r(8945),v=function(e){var t,r=e.message,u=e.location,g=(0,o.Z)((0,d.useState)({email:""}),2),v=g[0],w=g[1],j=(0,o.Z)((0,d.useState)("Subscribe"),2),_=j[0],y=j[1],b=m(v),N=b.errors,k=b.validateForm,Z=b.onBlurField,S=(t=(0,i.Z)(function(e){var t,r;return(0,l.__generator)(this,function(i){switch(i.label){case 0:if(e.preventDefault(),!k({form:v,errors:N,forceTouchErrors:!0}).isValid)return[2];switch((t=e.target).classList.remove("success"),y("Sending..."),r=[],u){case"middleOfPost":default:r.push(3601975);break;case"endOfPost":r.push(3617774);break;case"aboutPage":r.push(3626182);break;case"homePage":r.push(3626894)}i.label=1;case 1:return i.trys.push([1,3,,4]),[4,x.Z.post("https://lukethewebdev.api.up.railway.app/addSubscriber",null,{params:{email:v.email,tags:r}})];case 2:return 200===i.sent().status?(t.classList.add("success"),y("Subscribed!")):y("Try again"),[3,4];case 3:return i.sent(),y("Try again"),[3,4];case 4:return[2]}})}),function(e){return t.apply(this,arguments)});return(0,c.jsxs)("form",{className:f().signup,children:[(0,c.jsx)(p(),{src:"/images/signup.svg",alt:"Newsletter icon",width:"50",height:"50",className:f().filterDarkBlue}),(0,c.jsxs)("div",{className:f().right,children:[(0,c.jsx)("p",{className:f().text,children:r}),(0,c.jsxs)("div",{className:f().formFieldsContainer,children:[(0,c.jsxs)("div",{className:f().inputContainer,children:[(0,c.jsx)("input",{type:"text",placeholder:"Email address",name:"email",className:(0,h.Z)(f().input,N.email.dirty&&N.email.error&&f().formFieldError),onChange:function(e){e.preventDefault();var t=e.target.name,r=(0,n.Z)((0,s.Z)({},v),(0,a.Z)({},t,e.target.value));w(r),N[t].dirty&&k({form:r,errors:N,field:t})},onBlur:Z,value:v.email,noValidate:!0}),N.email.dirty&&N.email.error?(0,c.jsx)("p",{className:f().formFieldErrorMessage,children:N.email.message}):null]}),(0,c.jsx)("input",{id:"submit",type:"submit",value:_,className:"signupSubmit",onClick:S})]})]})]})}},2272:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSG:function(){return _}});
1var i=r(6042),a=r(9396),s=r(9534),n=r(5893),o=r(9008),l=r.n(o),c=r(5675),d=r.n(c),m=r(7845),u=r(4876),p=r(4283),h=r(7704),g=r(9861),f=r(6869),x=r(7562),v=r(7594),w=r.n(v),j=r(120),_=!0;t.default=function(e){var t,r=e.id,o=e.frontmatter,c=e.content,v=e.otherPosts;return(0,n.jsxs)("div",{className:"background",children:[(0,n.jsxs)(l(),{children:[(0,n.jsx)("meta",{charset:"utf-8"}),(0,n.jsx)("meta",{name:"author",content:"Luke Anderson"}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),(0,n.jsx)("title",{children:o.title}),(0,n.jsx)("meta",{name:"description",content:o.preview}),(0,n.jsx)("meta",{property:"og:title",content:o.title}),(0,n.jsx)("meta",{property:"og:description",content:o.preview}),(0,n.jsx)("meta",{property:"og:url",content:"https://luketheweb.dev/blog/".concat(r)}),(0,n.jsx)("meta",{property:"og:image",content:"https://luketheweb.dev/images/".concat(o.previewImage,".jpg")}),(0,n.jsx)("meta",{property:"og:type",content:"article"}),(0,n.jsx)("meta",{property:"article:published_time",content:o.date}),(0,n.jsx)("meta",{property:"article:author",content:"Luke Anderson"}),(0,n.jsx)("meta",{property:"og:site_name",content:"Luke the Web Dev"}),(0,n.jsx)("meta",{name:"twitter:title",content:o.title}),(0,n.jsx)("meta",{name:"twitter:description",content:o.preview}),(0,n.jsx)("meta",{name:"twitter:image",content:"https://luketheweb.dev/images/".concat(o.previewImage,".jpg")}),(0,n.jsx)("meta",{property:"twitter:card",content:"summary"}),(0,n.jsx)("meta",{name:"twitter:site",content:"@luke_the_webdev"}),(0,n.jsx)("meta",{name:"twitter:creator",content:"@luke_the_webdev"})]}),(0,n.jsx)("main",{className:"blogPost",itemScope:"",itemType:"http://schema.org/BlogPosting",children:(0,n.jsxs)("div",{className:"content",children:[(0,n.jsx)("h1",{itemProp:"headline name",children:o.title}),(0,n.jsxs)("div",{className:"postDetails",children:[(0,n.jsx)(d(),{src:"/images/luke-anderson.webp",alt:"Luke Anderson",width:"40",height:"40",priority:!0,className:"authorImage"}),(0,n.jsx)("h4",{className:"authorName",itemProp:"author",children:"Luke Anderson"}),(0,n.jsx)("h4",{className:"publishedDate",itemProp:"datePublished",children:(t=o.date,j.ou.fromISO(t).setLocale("en-GB").toLocaleString(j.ou.DATE_FULL))})]}),(0,n.jsx)(d(),{src:"/images/".concat(o.previewImage,".webp"),alt:o.title,width:"358",height:"170",style:{height:"auto",width:"100%"},sizes:"(max-width: 1200px) 100vw, 70vw",priority:!0,className:"featureImage",itemProp:"image"}),(0,n.jsx)("article",{itemProp:"articleBody",children:(0,n.jsx)(m.D,{remarkPlugins:[h.Z],linkTarget:"_blank",components:{code:function(e){var t=e.node,r=e.inline,o=(e.className,e.children),l=(0,s.Z)(e,["node","inline","className","children"]);return r?(0,n.jsx)("code",(0,a.Z)((0,i.Z)({className:"md-post-code"},l),{children:o})):(0,n.jsx)(u.Z,(0,a.Z)((0,i.Z)({style:p.Qn,wrapLines:!0,language:"javascript",PreTag:"div",showLineNumbers:!0,useInlineStyles:!0,lineProps:function(e){if(!(null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.meta))return{};var r,i,a=/{([\d,-]+)}/,s=null===(i=t.data.meta)||void 0===i?void 0:i.replace(/\s/g,""),n=(null==a?void 0:a.test(s))?null==a?void 0:a.exec(s)[1]:"0";return{data:w()(n).includes(e)?"highlight":null}}},l),{children:String(o).replace(/\n$/,"")}))},h6:function(e){return e.node,e.inline,e.className,e.children,(0,s.Z)(e,["node","inline","className","children"]),(0,n.jsx)(x.Z,{message:"If you're enjoying the read, please consider signing up to my newsletter to receive notifications when new posts are added!",location:"middleOfPost"})}},children:c})}),(0,n.jsx)(x.Z,{message:"If you enjoyed the read, please consider signing up to my newsletter to receive notifications when new posts are added!",location:"endOfPost"}),(0,n.jsx)(g.Z,{id:"giscusComments",repo:"LukeTwomey/LukeTheWebDev",repoId:"R_kgDOI2bJWw",category:"Announcements",categoryId:"DIC_kwDOI2bJW84CT4Cv",mapping:"title",reactionsEnabled:"1",emitMetadata:"0",inputPosition:"bottom",theme:"https://lukethewebdev.api.up.railway.app/giscusCss",lang:"en",loading:"lazy"},o.title),(0,n.jsx)("section",{className:"previews",children:(0,n.jsx)(f.Z,{posts:v,theme:"light"})})]})})]})}},4603:function(e){e.exports={signup:"SignupForm_signup__iSQVy",text:"SignupForm_text___JD2B",filterDarkBlue:"SignupForm_filterDarkBlue__gQxa4",formFieldsContainer:"SignupForm_formFieldsContainer__xNz0F",inputContainer:"SignupForm_inputContainer__4cnJz",formFieldError:"SignupForm_formFieldError__8qswx",formFieldErrorMessage:"SignupForm_formFieldErrorMessage__p3P1f"}}},function(e){e.O(0,[881,456,391,774,888,179],function(){return e(e.s=516)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.