Astro Repo

Astro README.md

2 min read

I Love Astro

I really do believe that Astro is the future of web development. It’s just writing HTML and CSS with extra steps. But those extra steps is what makes it SO. GOOD.

Framework Agnostic

What framework do you use? Oh wait, It doesn’t matter. You can use whatever your heart desires. Need to learn all of the new NextJS things just to use React? Nope.

Astro SSR 💖

It’s like PHP but with components. So actually better.


Installing Astro + Preferred Adds

Astro

npm create astro@latest

MDX

npx astro add mdx

Sitemap

npx astro add sitemap

Tailwind

npx astro add tailwind

Solid

npx astro add solid

SEO

These seem so similar

Astro SEO has 50k downloads

npm install astro-seo

Astrolib SEO has 14k downloads

npm install @astrolib/seo

I prefer the cut of Astrolibs jib, but testing is required.

Bugs

There is a bug on this page, that I cannot figure out.

For some reason the anchor tag is not getting the class added to it.

But it works on every other page…

function highlightRepoMenu() {
    if (!window.location) return;

    const pathname = window.location.pathname;
    document.querySelector(`a[href="${pathname}"]`)?.classList.add("current");
}

document.addEventListener("astro:page-load", (ev) => {
    highlightRepoMenu();
});

I’ll put this here for now as a todo for future me.

Fixed: dev 101, check for typos.