To get started, you need to clone this repository to your local machine. You can do this using Git or the GitHub CLI.
Run the following command in your terminal:
git clone https://github.com/your-username/your-repo.git
cd your-repo
If you have the GitHub CLI installed, you can clone the repository with:
gh repo clone your-username/your-repo
cd your-repo
Once cloned, install the project dependencies:
npm install
Now, youβre ready to start editing and running the project! π
Inside your Astro project, you'll see the following folders and files:
/
βββ public/
β βββ favicon.svg
βββ src/
β βββ layouts/
β β βββ Layout.astro
β βββ pages/
β βββ index.astro
βββ package.json
To learn more about the folder structure of an Astro project, refer to our guide on project structure.
The main page of this project is located at:
π src/pages/index.astro
To update your links:
- Open
index.astro
in your code editor. - Locate the section where links are defined (inside the
<main>
or<section>
tags). - Modify or add new links following the structure provided.
Example:
const links = [
{
title: 'Website',
url: 'https://giftegwuenu.com',
icon: 'https://api.iconify.design/mdi:web.svg?color=white',
},
];
- The overall layout is managed in
src/layouts/Layout.astro
. - To modify styles, check the CSS or styles in the global file (if applicable).
- Replace
favicon.svg
inside thepublic/
folder with your own icon.
Cloudflare Pages is a great option for hosting Astro projects, offering a fast and free way to deploy your link-in-bio site.
Ensure your project is in a GitHub repository. If not, create a new repository and push your code:
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/your-username/your-repo.git
git push -u origin main
- Go to Cloudflare Pages.
- Click "Create a project" and select "Connect to GitHub".
- Authorize Cloudflare to access your repository.
- Select your repository and click "Begin setup".
- Set the framework preset: Choose Astro.
- Build command:
npm run build
- Output directory:
dist
- Click "Save and Deploy".
- After deployment, youβll get a Cloudflare subdomain (e.g.,
your-project.pages.dev
). - To use a custom domain, go to the "Custom Domains" tab in Cloudflare Pages and add your domain.
Any time you push changes to your GitHub repo, Cloudflare Pages will automatically redeploy the latest version.
All commands are run from the root of the project in 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 |