How I added a sitemap to Next.js website (next-sitemap)

  Рет қаралды 32,533

caleyCodeLab

caleyCodeLab

Күн бұрын

In order to improve the SEO ranking of a new website I had built using Next.js I decided I needed to add the automatic generation of a sitemap xml and robots.txt to the build process.
The website is statically exported from Next and then hosted on an S3 bucket in AWS.
This video documents me attempting to achieve the above
props to this NPM module www.npmjs.com/...
#nextjs
Senior web developer focusing on Javascript, React and Node.
🎨 My Editor Settings
Visual studio code
Afterglow
support me - magic.freetrad...
Code examples used in videos are uploaded here: github.com/mic...
Visit the channel here: / @caleycodelab
Say hello on instagram here: / caleyinbriefs

Пікірлер: 73
@in3135
@in3135 3 жыл бұрын
Good video ! I like how you struggle, it is cool to see that we are not alone :)
@kristiyanivanov7414
@kristiyanivanov7414 2 жыл бұрын
yes, tbh this :D
@RizaHariati
@RizaHariati 2 жыл бұрын
Same!
@joostschuur
@joostschuur 2 жыл бұрын
I took a shot everytime you said sitemap and now I'm too drunk to code. Best time ever.
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
🤣
@abdulrahmanelheyb
@abdulrahmanelheyb 2 жыл бұрын
Wow, I tried search how can solve this problem but I not found, after when find your video I solved thank you so much 🥰
@BigPerm73
@BigPerm73 2 жыл бұрын
😆Please keep making tutorials. I enjoyed this and you helped a ton.
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Thank you! Working on one right now 🍻
@Fullflexno
@Fullflexno 2 жыл бұрын
Supercool video buddy! Love your snarky and humourus comments, keep posting pleas!=)
@A-Miracle000
@A-Miracle000 2 жыл бұрын
wow the way you explain is just fantastic keep it up
@gabrielmoraes4516
@gabrielmoraes4516 2 жыл бұрын
Awesome video! I can so relate to 4:24 LOL!
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
🙏
@testrandom1852
@testrandom1852 2 жыл бұрын
Love the way you teach.
@hackneythugg
@hackneythugg 4 ай бұрын
4:30 LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOL - Only a develper would understand!
@RizaHariati
@RizaHariati 2 жыл бұрын
Thank for the tutorial man... 😁😁
@ErkanYuksel111
@ErkanYuksel111 9 күн бұрын
Greetings from Türkiye love that video :)
@nickwong1652
@nickwong1652 2 жыл бұрын
It's cool bro~ very useful
@billardmelissa4608
@billardmelissa4608 Жыл бұрын
Thanks to you for that , very helpful 😉
@shawnlee5956
@shawnlee5956 2 жыл бұрын
thx for sharing ~ you look very enjoying coding ~
@tochukwungene
@tochukwungene Жыл бұрын
I totally agree at 4:36. Never! It's frustrating!
@adityashrivastava8352
@adityashrivastava8352 2 жыл бұрын
Thanx bro. It helped a lot.
@kristiyanivanov7414
@kristiyanivanov7414 2 жыл бұрын
nice, you put some emotion into it and that's good to see - people these days seem robotic :)
@pbhalshankar5
@pbhalshankar5 Жыл бұрын
i really love your reaction on error ....Its never straight forward...never like that......😂😅
@ngocthienvu7903
@ngocthienvu7903 Жыл бұрын
i love it, it's so funny
@wixet17
@wixet17 2 ай бұрын
POG, thank u!!!
@ayodejiatanda6197
@ayodejiatanda6197 Жыл бұрын
thank you! they need to fix their documentation 😂
@TonicCantaloupe
@TonicCantaloupe 10 ай бұрын
Whats the process now in 2024, with the latest version of NextJS? Has anything changed?
@burakozcan4472
@burakozcan4472 2 жыл бұрын
for those who have problems yarn next export and cd out run npx http-server
@patitorodri
@patitorodri Жыл бұрын
thanks mate, you are funny
@adarshrathi8265
@adarshrathi8265 2 жыл бұрын
excellent excellent love from india har har mahadev
@arewabookspublishers
@arewabookspublishers 3 жыл бұрын
Thank you for the Video, But i'm getting that error even when run build. please what should I should do? my node version is 16.14.0 while the npm 8.3.1
@caleyCodeLab
@caleyCodeLab 3 жыл бұрын
If you're on windows you need to rename the config file. The issue is documented on their npm page. Your node version should be fine. But you should consider using NVM so you're flexible
@anjurawat9274
@anjurawat9274 2 жыл бұрын
I have one doubt why did you install in dev dependency?
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
It's a dev dependency because I only need the package at build time. You only want to add a package to none dev dependencies if it's required to execute once built
@anjurawat9274
@anjurawat9274 2 жыл бұрын
@@caleyCodeLab got it. Thanks
@MrWalrusxD
@MrWalrusxD 2 жыл бұрын
Really nice video! I'm new to React/Next, can someone explain me what the /out is? Is that something like a live server? Can't find it on the web :)
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
/out is a folder next generates when you statically export a website
@JunoYu-z3w
@JunoYu-z3w Жыл бұрын
R u walton raiders?
@taranpreetsingh6135
@taranpreetsingh6135 3 жыл бұрын
npm install next-sitemap --save-dev gives me an error found incompatible module. Please help
@caleyCodeLab
@caleyCodeLab 3 жыл бұрын
What version of node are you running?
@taranpreetsingh6135
@taranpreetsingh6135 3 жыл бұрын
@@caleyCodeLab I got v14.18.1
@caleyCodeLab
@caleyCodeLab 3 жыл бұрын
If you throw up a repo I'll take a look when I get a chance 🏋️
@taranpreetsingh6135
@taranpreetsingh6135 3 жыл бұрын
@@caleyCodeLab Please tell how to update node version. I have tried the command but it wasn't updating
@TK-kw2pg
@TK-kw2pg 2 жыл бұрын
Why is it that mine dont generate a robots.txt and xml
@mariusnjikenjike3119
@mariusnjikenjike3119 2 жыл бұрын
Hey man, I'm having an error after running . SyntaxError: Unexpected token 'export' could you please suggest any idea on how to solve it?? Thank you for the video.
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Have you successfully exported and are able to run it as a static site? Sounds like config but very difficult to say
@martineboulanger
@martineboulanger 9 ай бұрын
Explanations are good, but please if you explain something and you want to use you webcam too, face the webcam when you speak. It is just weird to look at your side profile
@alanhettinger4051
@alanhettinger4051 2 жыл бұрын
Why did you create a "sitemap" script rather than using the "postbuild" script as suggested in the docs?
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Because sitemap is just one post build operation. Postbuild is too generic
@Its_nirbhay_gupta_
@Its_nirbhay_gupta_ Жыл бұрын
How are you so cool dude😅
@caleyCodeLab
@caleyCodeLab Жыл бұрын
I'm going to assume this is some dry sarcasm
@imkir4n
@imkir4n 2 жыл бұрын
getting 404 when i go to route sitemap!!! why
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Difficult to say unless you sling a repo
@imkir4n
@imkir4n 2 жыл бұрын
@@caleyCodeLab i managed to fix that, thank you
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Good man!
@ardibandilli6437
@ardibandilli6437 2 жыл бұрын
@@imkir4n how you fixed that?
@imkir4n
@imkir4n 2 жыл бұрын
@@ardibandilli6437 you need to place that sitemap.xml file inside public folder
@biglmnztv
@biglmnztv 2 жыл бұрын
just subbed man, do you collaborate on projects for fun? seeking a mentor 🍋
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Hey thanks 🤲 at the moment no due to my actual job being really busy. I like the idea of it in the future though !
@jennysquesttowellness
@jennysquesttowellness 2 жыл бұрын
mate why are all our pages in sitemap-0.xml and not on sitemap.xml? isn't this confusing?
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
Just a bit of config with the sitemap package. You can change it, but I've had my sites successfully crawled with it as default
@jennysquesttowellness
@jennysquesttowellness 2 жыл бұрын
@@caleyCodeLab thanks so google will understand that your pages are listed in sitemap-0.xml and not on sitemap.xml, correct?
@gilmar770
@gilmar770 2 жыл бұрын
@@jennysquesttowellness Man, i have this doubt too...
@caleyCodeLab
@caleyCodeLab 2 жыл бұрын
The tool you can use to check whether your sitemap has been indexed properly is called 'google search console'. There's a tab called sitemap where it gives you all the information they have collected from you
@NikitaPant-tl8gw
@NikitaPant-tl8gw Жыл бұрын
any solution, how to change this ?
Improving SEO with (Dynamic) Sitemaps in Next.js
17:29
Leigh Halliday
Рет қаралды 38 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
The Easy Way to Design Top Tier Websites
11:54
Sajid
Рет қаралды 719 М.
Mastering the basics of SEO in React and Next.js
12:05
Leigh Halliday
Рет қаралды 48 М.
Rank #1 on Google - Next.js SEO Checklist
21:55
Cole Blender 🇺🇸
Рет қаралды 549
9 Web Design Trends 2025 to Spruce Up Your Site
16:33
Showit
Рет қаралды 103 М.
This is How I Scrape 99% of Sites
18:27
John Watson Rooney
Рет қаралды 264 М.
React Course - Advanced - SEO
19:46
Techbase
Рет қаралды 56 М.
Managing Assets and SEO - Learn Next.js
14:18
leerob
Рет қаралды 18 М.
Kidnapped Boy Found In Fridge | #Shorts | PD TV
0:59
PD TV
Рет қаралды 9 МЛН
Duy Beni 14. Bölüm
2:22:58
Duy Beni
Рет қаралды 3,6 МЛН