Source code for my personal portfolio website, hosted at https://alejandrofernandez.dev/.
For setup instructions, refer to INSTALL.md.
This project includes the following primary folders and files:
/
├── public
│ ├── assets
│ ├── favicon.svg
│ └── _headers
├── src
│ ├── components
│ ├── content
│ ├── content.config.ts
│ ├── i18n
│ ├── layouts
│ ├── pages
│ └── styles
└── package.json
-
Astro looks for
.astroor.mdfiles in thesrc/pages/directory. Each page is exposed as a route based on its file name. -
Components, regardless of framework (Astro/React/Vue/Svelte/Preact), go in
src/components/. -
Static assets, like images, should be placed in
public/.
Common development tasks are unified into npm scripts. All commands are executed from the project root.
| Command | Action |
|---|---|
npm ci |
Installs dependencies as per package-lock.json |
npm install <package> |
Adds and installs a new dependency |
npm run upgrade-deps |
Upgrades dependencies to the latest non-major versions |
npm run dev |
Starts a local dev server at localhost:4321 |
npm run build |
Builds the production site to ./dist/ |
npm run preview |
Previews the production build locally |
npm run astro ... |
Executes Astro CLI commands (e.g., astro add) |
npm run lint |
Runs static code analysis |
npm run deploy |
Deploys the site to Cloudflare Pages |
Note: The
shellcheckbinary is downloaded automatically on the first execution ofnpm run lint.
This project is designed to be deployed to Cloudflare Pages. You can use its Git integration to make a new deployment for each commit to the main branch. Additionally, you can make a deployment with the following command:
npm run deployCloudflare Pages creates a new deployment branch for each of the git branches that you deploy from. The main branch corresponds to the Production environment, and any other branch is a Preview environment. If you want to deploy the main branch to a Preview environment (or viceversa), specify the target branch with the DEPLOY_BRANCH environment variable (by default it deploys to the current branch).
DEPLOY_BRANCH=test npm run deployTo test the website in a production-like environment, run:
npm run previewThe previous command deploys the project to a local server using Wrangler, a CLI tool by Cloudflare. Wrangler also allows to emulate Cloudflare R2 buckets, and you can add objects to the emulated local storage as follows:
npx wrangler r2 object put <bucket-name>/<object-name> --local --file /path/to/fileAuditing the production build with Lighthouse is also recommended.
This project uses the Material Design system for defining a color theme. Follow the instructions in the Material Theme Builder to build your own Material theme. For more information, check the Material Design website.
For a personalized typography, you can integrate open-source fonts from Fontsource. Fontsource packages multiple fonts into individual NPM packages for easy self-hosting.
Project icons have been sourced from Phosphor Icons and Font Awesome.