- Astro for static site generation (SSG)
- Tailwind CSS for styling
- Sanity for the content management system (CMS)
This website was built with Astro, a static site generator (framework) for content-driven websites.
Well, the previous iterations of this website were built using GatsbyJS, which was a SSG first framework and I loved how fast my website was. When I looked at Astro, I saw that it had SSG-first approach as well which is what I wanted.
Not only was it fast, Gatsby had one of the best plugin ecosystem for a JavaScript I have seen. Even Next.js doesn't come close. Astro has its own "plugin" system, which allows integrations from different frameworks such as React, Vue, Svelte, Solid in my case, I used React components to handle state changes in some parts of this site, such as Services toggler system.
When I first started off as a programmer, I didn't know that I would one day need to have a portfolio to showcase my work. I have made four iterations of the same website (this being the forth) and last two were built with GatsbyJS, a React based framework.
npm create astro@latest -- --template basics
Inside of your Astro project, you'll see the following folders and files:
/
├── public/
│ └── favicon.svg
├── src/
│ ├── components/
│ │ └── Card.astro
│ ├── layouts/
│ │ └── Layout.astro
│ └── pages/
│ └── index.astro
└── package.json
Astro looks for .astro
or .md
files in the src/pages/
directory. Each page is exposed as a route based on its file name.
There's nothing special about src/components/
, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
Any static assets, like images, can be placed in the public/
directory.
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro -- --help |
Get help using the Astro CLI |
Feel free to check our documentation or jump into our Discord server.