Astro Crash Course

Sdílet
Vložit
  • čas přidán 2. 05. 2024
  • Astro is an amazing static site generator that allows you to build really fast websites with little to no production JavaScript. You can use Astro components as we all have components from other frameworks such as React, Vue and Svelte.
    TIP: I forgot to mention there is a VS Code extension called "Astro". Use it for syntax highlighting.
    💻 Github Repo:
    github.com/bradtraversy/astro...
    ⭐ All Courses
    traversymedia.com
    💖 Show Support
    Patreon: / traversymedia
    PayPal: paypal.me/traversymedia
    👇 Follow Traversy Media On Social Media:
    Twitter: / traversymedia
    Instagram: / traversymedia
    Linkedin: / bradtraversy
    Timestamps:
    0:00 - Intro / What Is Astro?
    3:20 - Project Demo
    6:20 - Create A New Astro Project
    7:50 - Folder Structure
    10:19 - Run Dev Server & Prepare
    11:18 - Astro Components
    16:00 - Making a Request - Top Level Async
    17:13 - Create A Layout
    20:29 - Passing Props
    23:17 - Start Project / Global Styling
    26:53 - Header Component
    31:38 - React Integration
    37:10 - Showcase Component
    43:18 - Features & Card Components
    49:34 - Dynamic Classes - Dark Card
    51:40 - Page Content & Tabs Component
    1:03:28 - Footer Component
    1:05:19 - About Page
    1:08:37 - Refactor Card Component
    1:10:53 - Blog Page & Markdown Files
    1:18:44 - Fetching Markdown FIles
    1:20:57 - Blog Showcase Component
    1:22:50 - Single Post Page / getStaticPaths()
    1:29:35 - Build Static Assets
    1:30:40 - Deploy To Netlify
  • Věda a technologie

Komentáře • 247

  • @astrodotbuild
    @astrodotbuild Před rokem +500

    We made it!!! 🥳🥳🥳🥳
    What an amazing video, first class as always,
    Thank you Brad,
    From Astro
    with 💚

    • @Arabian_Epileptic
      @Arabian_Epileptic Před rokem +36

      You just got the best endorsement ever 💯 congrats

    • @PenguinCrayon269
      @PenguinCrayon269 Před rokem +8

      Senpai notices

    • @TraversyMedia
      @TraversyMedia  Před rokem +36

      Thanks so much! And great job!

    • @ahmad-murery
      @ahmad-murery Před rokem +5

      I really don't use any static website generator, but this was a different story,
      Well done Astro and Brad 👍

    • @harvirreturn
      @harvirreturn Před rokem

      Make a laravel admin panel management system video , can use packages like filament. Thank you!

  • @AlfredAyache
    @AlfredAyache Před 7 měsíci +20

    Caution: if you're following along with version 3.1.0 (or later) of Astro, about 30 minutes when you're doing the Header, the logo won't show up. You have to add `.src` to the logo variable being used in the `src` attribute of the `img` tag. My (very) little contribution. Thanks Brad!

    • @Av1234100
      @Av1234100 Před 6 měsíci

      Your answer saved me a lot of time. Thanks a lot!

    • @CodeCrafterChannel
      @CodeCrafterChannel Před 6 měsíci +1

      I spent 3 hours on this. Lol. Next time, I'll definitely look into the comments first

    • @Breslima
      @Breslima Před 5 měsíci +2

      To add the images to the "Showcase" section

  • @TraversyMedia
    @TraversyMedia  Před rokem +163

    One important thing I forgot to mention that you'll probably figure out anyway, is there is an Astro VS Code extension. You'll want to install that for syntax highlighting in Astro components. Hope you enjoy the course!

    • @infomax807
      @infomax807 Před rokem

      Brad, github link is not working

    • @TheAdel136
      @TheAdel136 Před rokem +1

      hope that one day i will meet you in person and i'll say thanks face to face :)

    • @AzraiHasan
      @AzraiHasan Před rokem

      been waiting for this video....!!!! Thanks, Brad..!!!

  • @fabiorodrigo3638
    @fabiorodrigo3638 Před rokem +83

    Life is strange... We ran away from statics sites in the 2000`s, now we use the power of js to remove js to go back to static pages (and its very good).

    • @aaa-my5xy
      @aaa-my5xy Před rokem +10

      kinda like tailwind, we run away from inline styles for decades until people realize that if you tweak how inline styles work just slightly they're really good.

    • @XPLoXe
      @XPLoXe Před 8 měsíci +1

      @@aaa-my5xy I still hate CSS though.

  • @EddyVinck
    @EddyVinck Před rokem +75

    90+ minutes of free content, you’re a legend Brad 👏

  • @JEsterCW
    @JEsterCW Před rokem +4

    The most what I love about Astro is that it reminds me micro frontends, but in this case the "micro frontends" are the components. Idk but it feels amazing to me that you have the possibility to mix other technologies inside it. Micro frontends are smaller web apps in different frameworks/technologies made into one huge web app and thats why Astro reminds me micro frontends and i love it, overall the modern way of making stuff... you have separate components etc... its also lovely when you wanna to work with ur friend who works in different technology or stack or even maybe he doesnt likes some tools ure using, so u still can somehow cooperate together like each other in ur own stack and make it work, obviously it can be tricky, but this is the possibility and i love it.

  • @nro337
    @nro337 Před rokem +10

    Incredible tutorial as always, thanks so much Brad!

  • @Thomasfrank
    @Thomasfrank Před rokem +20

    Thanks so much for making this, and for including the API aside even though you weren't planning on using one for the content. I'm just learning Astro and this was extremely helpful.

  • @732brudder
    @732brudder Před rokem +2

    Yes! Been waiting on my favorite youtubers to post about this framework that I've been using for a few months now. Going to love diving into what you say about it.

  • @husnulaman
    @husnulaman Před rokem +8

    Just today I was thinking of revamping my portfolio. This is exactly what I needed. Thank you Brad ❤

  • @bookable7157
    @bookable7157 Před rokem +2

    Been following you for years. Great video as always. Thanks to the Astro team for creating this. Most small local businesses that I work with just want a static site, this really fits the bill.

  • @heguer87
    @heguer87 Před rokem +2

    Thanks Brad, you keep us up to date!!

  • @patricksmith8262
    @patricksmith8262 Před rokem +1

    Perfect timing! Was planning to start playing with @astro for a new personal project.

  • @WebDevEducation
    @WebDevEducation Před rokem +2

    LOVE THIS ❤ thank you for another awesome tutorial! ⚡

  • @ceralguy85
    @ceralguy85 Před rokem +3

    Awesome tutorial with Astro Brad. This technology is very light as powerful for static html. Amazing video as always

  • @johncarlosarmiento2666

    Thank you so much! It never cease to amaze me providing useful content!

  • @rian438
    @rian438 Před rokem

    Woah! What A nice timing, I am about to gather learning resources about this and suddenly your video notification appear on my screen, What a nice timing.

  • @davitgogidze4310
    @davitgogidze4310 Před rokem

    As always with high quality and relevant content 🎓 ⚡ 🔥

  • @petipois28
    @petipois28 Před rokem

    Awesome tutorial - really love your teaching style. Thank you for creating such amazing content.

  • @Allformyequine
    @Allformyequine Před rokem

    So GREAT Brad and Astro YAY!! Thank you so nicely done!! Just luv this and can't wait to try Astro :)

  • @druharper
    @druharper Před rokem +1

    Excellent work. Cannot thank you enough. I’m excited to get started 🙂

  • @code_with_sheynet
    @code_with_sheynet Před rokem +3

    Weldone Brad, I just love, thanks for all your have done for me

  • @Dameworth
    @Dameworth Před rokem

    Awesome tutorial thank you, I might have to try this out some more it's actually really nice for static sites

  • @male3399
    @male3399 Před rokem +14

    What a coincidence, just a few seconds ago, I was wondering if Brad is going to do a crash course for Astro soon, and BOOOOM here's this video that shocks me right away

  • @piwi7212
    @piwi7212 Před rokem

    A real Master gives a little "Masterclass". Thank you Brad. Greetings from Hamburg Germany

  • @girornsveinsson7970
    @girornsveinsson7970 Před rokem +1

    I would love to see a full course from you about Astro development - I will buy it in a heartbeat!

  • @alittlegreyhair1104
    @alittlegreyhair1104 Před rokem

    Another great tutorial, thank you Brad

  • @janzenfaidiban
    @janzenfaidiban Před rokem

    Thank you Brad... You lessons really easy to follow.

  • @smibssmibs
    @smibssmibs Před rokem

    Top class tutorial. Definitely worth the time. You provide amazing service. Thanks.

  • @EricShans
    @EricShans Před rokem

    Thanks as always. Planning on using this from now on!

  • @jamesgrubb
    @jamesgrubb Před rokem

    Fantastic tut as always. Thank you.

  • @trinkel8
    @trinkel8 Před rokem +1

    Excellent content Brad!

  • @yuujin1337
    @yuujin1337 Před rokem

    Just what I needed, thank you sir!

  • @robhafemeister3100
    @robhafemeister3100 Před 3 měsíci

    Awesome stuff like always, thanks much Brad

  • @Karrnfr
    @Karrnfr Před rokem

    Thank you for this tutorial Brad 👊🏾🙏🏽

  • @thedevnoteyt
    @thedevnoteyt Před rokem +2

    Thank you so much for this 😀

  • @johnnymags
    @johnnymags Před rokem +1

    Great tutorial, thank you!

  • @maskman4821
    @maskman4821 Před rokem +2

    Awesome tutorial 😍

  • @PeterChapman-py
    @PeterChapman-py Před rokem

    Thank you for this tutorial! Astro is pretty great!

  • @dontmindme4009
    @dontmindme4009 Před rokem +2

    Damn Astro is awesome. I like how simple it is

  • @TechBuddy_
    @TechBuddy_ Před rokem +2

    I thought I am the only crazy kid using sublime text as a modern notepad replacement but now I see Mr. Traversy himself using it, I'm not that crazy after all. Love your work man. Thank you

    • @NiagaraThistle
      @NiagaraThistle Před rokem +1

      I use Sublime for the same...there's at least 3 of us!

  • @champorado2131
    @champorado2131 Před 8 měsíci +2

    I hope you do an updated tutorial using ver 3.0

  • @syberiaok
    @syberiaok Před rokem

    Best course ever, thank you so much!!!!

  • @JamalKhan-dq4nz
    @JamalKhan-dq4nz Před rokem

    I can't express the way i want to thank you brad sir

  • @damagee8141
    @damagee8141 Před rokem

    Perfect timing!

  • @slandrei
    @slandrei Před rokem

    You are the best!! Waiting to see more from you. Thanks! :)

  • @CodeLitDev
    @CodeLitDev Před rokem

    A high quality content as always. 🔥

  • @-0-__-0-
    @-0-__-0- Před 11 měsíci

    Finished the video my guy. Its up and hosted. Thank you so much 😉

  • @kubakazimierczak6646
    @kubakazimierczak6646 Před rokem +4

    18:16 - another way (instead of opening sublime) is to open new tab in vs code and select HTML as the language, then the Emmet will work

  • @diego0ji
    @diego0ji Před rokem

    Thanks brad🖤

  • @Stowy
    @Stowy Před rokem

    This was very clear, thanks a lot !

  • @Mynameisdidi1997
    @Mynameisdidi1997 Před rokem +2

    Thanks Brad!
    Hope Astro gets some more attention to generate even more contributions.

    • @TraversyMedia
      @TraversyMedia  Před rokem +3

      Same here. I think people just think "great, another framework". But it is so simple and such a great modern way to create static sites

  • @cmnweb
    @cmnweb Před rokem +1

    Ufff, estaba esperando esto, saludos desde México.

  • @XPLoXe
    @XPLoXe Před 8 měsíci +1

    Thank you so much for this amazing video. It's a 10/10 material.

  • @MrBioneto
    @MrBioneto Před rokem

    Thnaks Brad, it has been usefull. Astro looks amazing!

  • @christopheanfry2425
    @christopheanfry2425 Před rokem +1

    We’re enjoying thanks. One thing regarding the emmet for the “!” to generate automatically html template. You can start typing html and you select html:5 it generates the same template as the “!”.

  • @harvirreturn
    @harvirreturn Před rokem +1

    If possible please make a react front end for Laravel. This is a nice combination that is not seen often.
    Naturally, thank you for for all the videos you provide. They are immense help.

  • @chronosceptor
    @chronosceptor Před rokem

    thanks Brad this was fun

  • @CyanidePierce90
    @CyanidePierce90 Před rokem +3

    Brilliant course thanks Brad. Would there be the possibility of you doing a followup tutorial of adding to it with a NetlifyCMS (or similar) so we can add pages and blog posts that way?

  • @youdjparents
    @youdjparents Před rokem +1

    thank you for this course Brad! Request - a tutorial on ArchieML + Astro/Sveltekit? Or some kind of markdown that is more robust with a framework? A lot of editorial people use aml and it can be confusing to get set up

  • @it-s-me-mohit
    @it-s-me-mohit Před rokem +2

    Awesome stuff Brad as always 😉😉. Apart from blogs what usecases can be there for Astro??

  • @Helix_22
    @Helix_22 Před rokem

    I really enjoyed this guide, and it is honestly making it painful to find and watch other Astro videos due to the lack of foresight. You've always seem to bring that into the guides. Do you have any more Astro projects or guides in the pipeline? I really do hope you make some more begginer friendly guides on Astro.

  • @DC-xt1ry
    @DC-xt1ry Před rokem +1

    Another priceless jewel!

  • @devchabek8728
    @devchabek8728 Před rokem

    Thank you !

  • @ChristianKolbow
    @ChristianKolbow Před rokem

    Good Job. 😊
    @TraversyMedia There is no reason for Fragments in Astro. Only when you map an Array is Fragment recommended or needed.

  • @AhmedAl-Kurdi
    @AhmedAl-Kurdi Před rokem

    u are amazing i was just thinking why no one talk about astro thanks

    • @tristen_grant
      @tristen_grant Před rokem

      There are a few channels talking about Astro.

  • @JamesQQuick
    @JamesQQuick Před rokem

    Amazing!!

  • @prodigymuj
    @prodigymuj Před rokem

    Amazing tutorial Brad! Thank you for sharing this. I did want to point out that the Tabs component doesn't work on Safari but it does on Chrome.

    • @prodigymuj
      @prodigymuj Před rokem

      I built the website and got it hosted on Netlify as well but it's the same result on Safari. The tabs don't work. Not sure what the issue is though

    • @ztcanada_1
      @ztcanada_1 Před rokem

      @@prodigymuj Helpline 📲📩
      QUESTIONS CAN COME IN☝️⬆️ ⬆️

  • @gbrachetta
    @gbrachetta Před rokem +2

    To get emmet working on .astro files (or any, really) just add "emmet.includeLanguages": {"astro": "html"} to your settings.json.

  • @truthteachers
    @truthteachers Před rokem +7

    Hi Brad, just add "astro' -> "HTML' under "include languages' in vscode built-in emmet extension. Seems to work. Also, need to install the Astro VS Code extension by Astro. Only then the syntax highlighting, file type identification and autocomplete will work.

    • @ontheruntonowhere
      @ontheruntonowhere Před rokem

      Great advice. Works perfectly, ty!

    • @codehorror8076
      @codehorror8076 Před rokem

      You don't need the !, so you don't need to do that. Just type: html and it will auto suggest 3 options. Hit the HTML5 one. The same when creating a tag div.card for example. Or am I missing something?

  • @rolf-s
    @rolf-s Před rokem

    An Astro SSR-only video/tutorial would be cool! 👍(To see the possibilities)

  • @wusswuzz5818
    @wusswuzz5818 Před rokem

    I think you can re-enable emmet in newer versions of vscode, but the new way is just to start typing "html" and a list of options will appear one of which is "html:5"

  • @-0-__-0-
    @-0-__-0- Před 11 měsíci

    It gives me back the nostalgic feeling of writing jinja templates😅

  • @HelliosChannel
    @HelliosChannel Před rokem

    Thanks !

  • @zoro9878
    @zoro9878 Před rokem

    Brad, you are awesome!

    • @ztcanada_1
      @ztcanada_1 Před rokem

      Helpline 📲📩
      QUESTIONS CAN COME IN☝️⬆️ ⬆️..

  • @lakshitsagar6299
    @lakshitsagar6299 Před rokem

    Dude, I didn't even knew that something this powerful also existed....It has so much to explore🔥🔥🔥🔥🔥🔥.....If astro is so useful then why it is not popular than react and other frameworks...??

  • @dreamisover9813
    @dreamisover9813 Před rokem

    Thanks for another amazing tutorial!
    I wanted to mention that the link in the description doesn't lead me to the github repository, it has the 2 dots from the link verbatim. I had to go to your github to click on the repo

  • @pedroserapio8075
    @pedroserapio8075 Před rokem +1

    Great video Brad. Cannot say the same about Astro, or in particular the plug-ins that become useless after Astro 1.0.0 went out. Staying with Gatsby for now.

  • @riccardoguitar
    @riccardoguitar Před rokem

    A wonderful video again, always a first class content!!
    I'm wondering if there is a guide to use md files to dynamically fill html tags as you do in the video. I'm searching with a lot of key words but nothing comes up, do you have any suggestion to go deep on this topic? I'd like to see if it could be a nice solution for small personal sites, before to use a headless cms to fetch the data.

  • @julianvelez6563
    @julianvelez6563 Před rokem +1

    Nice work bro

  • @paulehrig6414
    @paulehrig6414 Před 8 měsíci

    Excellent video!!! Question/Issue: > when I run the 'npm run build' command > i don't get a useable dist directory > How do I get a directory like astro-website-theme on your githb ?>? Thanks ahead of time for your help!

  • @galinahappy6919
    @galinahappy6919 Před rokem

    Большое Вам спасибо 🙏

  • @benacker8525
    @benacker8525 Před rokem

    Hey Brad, great video. You can disable postCSS extension for prettier formatting and autocomplete in css files. I had the same issue and it was driving me nuts

  • @riveralonzo
    @riveralonzo Před rokem +1

    at around 26 minutes when the css is applied, my hello world did not center and it was driving me crazy. I watched step by step twice and reviewed the css, but I ended up just added a text-align: center style.
    Also, awesome tutorial. Excited to be learning this while I finish up school and go into a dev position next summer.

    • @Helix_22
      @Helix_22 Před rokem

      in the style sheet, check for
      h1,
      h2 {
      text-align: center;
      }
      Make sure to place it above the @meda and .element tags, just place it right below the other style section for the h1/2 classes.

  • @naveenbelandur7269
    @naveenbelandur7269 Před rokem +1

    Hi Brad I have been following your videos from past months as i am a newbie to web development i have a doubt , the crash course you have made on react express dom are they covered most part of the topics or only the main things or basic

  • @rajeshag7884
    @rajeshag7884 Před rokem

    Thank you

  • @codingprograms2078
    @codingprograms2078 Před rokem

    Savage 🔥 ...tabnine and co-pilot do get a annoying but helpful.. Conundrum🤣

  • @kimbapslayer1995
    @kimbapslayer1995 Před rokem

    Looks fun. I find it so funny that I can't really stand the look of gigantic CSS files anymore ever since I started using tailwind lol

  • @blessdarah1256
    @blessdarah1256 Před rokem

    If Brad says he's impressed then know that's the way to go!

    • @ztcanada_1
      @ztcanada_1 Před rokem

      Helpline 📲📩
      QUESTIONS CAN COME IN☝️⬆️ ⬆️...

  • @cabanford
    @cabanford Před rokem +1

    Hey Brad - you should run lighthouse, at the end of your video, to show how your Astro site does...

  • @PeterFelis
    @PeterFelis Před rokem

    hai Brad, is Astro not like sveltekit? I see lot's of similaries. And, thanks for the video. You are a real good instructor.

  • @CraigClayton-bk3ze
    @CraigClayton-bk3ze Před rokem

    Hi Brad, great video as always, could you do a vieo on Solidjs

  • @aaromnido
    @aaromnido Před rokem

    WoW!! Such a fantastic tutorial!! You make it a piece of cake, man!
    Sorry, may you share the initial HTML files? In this way, we'll can follow and reproduce the tutorial step by step.
    Many thanks, Brad! :)

  • @alwayssomewhere716
    @alwayssomewhere716 Před rokem

    you are the best

  • @codehorror8076
    @codehorror8076 Před rokem

    I didn't even know about copilot. I just installed it as I'm following along and damn this is amazing. Edit: Now I want to remove it because it's genuinely scaring me lol

  • @giovannicarosa8819
    @giovannicarosa8819 Před rokem

    I was having trouble with my blog posts frontmatter not being read. I read through the Astro Docs and seen theirs was enclosed in “ “ and that is what I had to do to make it work. So it would be title: “Your title” and so on. You didn’t seem to have to do that on yours but it wouldn’t work for me till I went back and put everything in parentheses.

  • @jaspreetmaan121
    @jaspreetmaan121 Před rokem

    we went from loading js with html to loading html with js to generate html with js and back to loading js in html. Now we will repeat this cycle again with web assembly and pyscript.

  • @415423591
    @415423591 Před rokem

    Does anyone know Brad's exact theme and settings for having things colourized as he has them? Mine are slightly different and I want to copy him.

  • @guitaristtom
    @guitaristtom Před 9 měsíci

    What is the VSCode extension that shows up at 12:21 that suggests / completes your styling?

  • @harvirreturn
    @harvirreturn Před rokem

    Make a laravel admin panel management system video , can use packages like filament. Thank you!