feat(blog): added first blog post
This commit is contained in:
parent
467a17d122
commit
d162989760
1 changed files with 27 additions and 0 deletions
27
src/content/posts/myExperiencesWithAstro.md
Normal file
27
src/content/posts/myExperiencesWithAstro.md
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
title: "My experiences with Astro"
|
||||||
|
description: ""
|
||||||
|
pubDate: "18 Feb 2026 21:07"
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
- what i learned about it
|
||||||
|
- astro components (similar to react components?)
|
||||||
|
- interactive components are difficult
|
||||||
|
- static dynamic routes (dynamically generated at build time, but static on the website)
|
||||||
|
- content collections
|
||||||
|
- mdx
|
||||||
|
-->
|
||||||
|
|
||||||
|
# What is Astro?
|
||||||
|
Astro is a static site generator that allows you to combine components together to quickly put together a website. It's somewhat similar to something like React, but instead of having the bloat of all the javascript it generates, Astro outputs a static HTML website. The only javascript it includes is what you write in `<script>` tags. It has bindings for those web frameworks, so you can use React components in your website alongside the astro ones. It will also still generate a static site that doesn't require any javascript other than what you put there yourself.
|
||||||
|
|
||||||
|
I found out about astro from [Éva's website](https://www.poti.chat/), which she made in Astro. She mentioned that it allowed you to use components, like React does, but outputs HTML "like in the good old days of the internet". This made me curious about it, as some of my friends at the time were making their own websites trying to recreate the look and feel of websites back in the day. Also, I had noticed that my website on Neocities took some time to load up all of the 88x31 buttons/badges that are on the front page. So I decided to give it a go, with some hopes that it would make the website quicker to load.
|
||||||
|
|
||||||
|
# My initial experieces with it
|
||||||
|
Coming from React, getting used to Astro's components took a while. I tried copying the React version of my website to Astro using its React bindings, but ran into issues with how Astro handles component properties. It seemed that they worked similar from the documentation, but in practice they have differences that caused my React components to not work. I spent way too long trying to figure out why it wasn't working, and eventually gave up.
|
||||||
|
|
||||||
|
After a while, I decided to try recreating my website in Astro using only Astro components the way it was meant to be used. It took a while to get used to, and a lot of referring back to the documentation as well as my React website, But I did manage to recreate my website using Astro! The Astro website used less components than the React website, and contained no javascript at all! There was one component that I couldn't figure out how to recreate in an Astro component, so that one is still a React component. But I do want to revisit it and try creating an Astro component of it again in the future. <!-- i fukcign forgor what happened TwT -->
|
||||||
|
|
||||||
|
# Would I recommend it?
|
||||||
|
Yes! Astro is very fun and somewhat simple to use. It is great if you want to create a static site without the bloat of a web framework's javascript, while also having the flexability of those web frameworks' components. It does take a bit to get used to, especially if you're used to using a web framework like React. But I believe that learning it is worth it! Astro can also be used to create interactive components as well, if that's something you want on your website. However, if you want the flexability and ease-of-use of an interactive react component, you will be disapointed here (unless you use a React component ;3).
|
||||||
Loading…
Add table
Add a link
Reference in a new issue