title: Refactoring, performance and some fun with styling

published on: 16.07.2023

tags: #astro #seo #blogging #refactoring #optimization

written by: Jakub Jachowski

Refactoring

In the last few days, I focused more on polishing the ‘current product’ rather than adding new features to my website. There were many places with some old styles written directly in the styles tag that needed to be replaced with Tailwind. Besides that, I found many places where the app looked - let’s say - not great. So I had some fun with rewriting, restyling, and refactoring in general.

TypeScript issues

In the meantime, I realized that TypeScript has been acting kind of weird for a while, so I began looking for some better configuration than mine. Unfortunately, I didn’t succeed with that; adding more options seemed to create even more issues with VSCode autocomplete and type error highlighting. I ended up using a simple configuration that you can check out in my repo - tsconfig.json. That, and reinstalling and reconfiguring the Astro plugin for VSCode, worked like a charm.

Sitemap

Appears that Astro provides sitemap integration. It’s a package that, when configured correctly, generates sitemap-index.xml and sitemap-0.xml, necessary for better SEO. Configuration looked straightforward, so I decided to go for it. All there was to do was add a link tag to the page head, create a robots.txt file with my page address, and add my page address to astro.config.mjs - super easy.

As I finish this round of refactoring and polishing, I’m happy with the progress I’ve made. The website now has improved code organization, better styling with Tailwind, and a seamlessly integrated sitemap for SEO benefits.

Thanks for reading. Until next time, happy coding 👨🏻‍💻!