This is a custom AstroWind template for deployment to GitHub pages
The original AstroWind template can be found here: source
How is this template fork different?
This fork is designed for those who are not extremely familiar with Astro, or even web development in general. It is designed to be a simple, easy to use template for those who want to get started with Astro, but don't want to spend hours configuring the template.
This fork is also designed to be deployed to GitHub pages, which is a free and easy way to host your website.
After running npm i
and npm run dev
for the first time, you can develop your site completely offline!
The core way this template is different from the original is that it heavily uses .js
config files to configure data and content for its site.
Here are a few common config directories and what you will find there:
src/config/site/*
- Site configurationsrc/config/home/*
- Home page configurationfeatured-posts.js
- Featured blog posts on the home pagehero.js
- Hero component configuration on the home pagecontent.js
- Main content component configuration on the home page
src/config/components/*
- Component configurationannouncement.js
- Announcement component configuration on all pagesfooter.js
- Footer component configuration on all pagesheader.js
- Header component configuration on all pageslogo.js
- Logo (text) component configuration on all pages
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 if they do not require any transformation or in the assets/
directory if they are imported directly.
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:3000 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run format |
Format codes with Prettier |
npm run lint:eslint |
Run Eslint |
npm run astro ... |
Run CLI commands like astro add , astro preview |
Here are some basic commands to get you up and running to develop with this template:
-
Install
npm
dependenciesnpm i
-
Start the development server
npm run dev
-
View your site at
localhost:3000
Live reload is enabled by default, so any changes you make will be reflected in the browser.
Deployment docs for GitHub Pages
First, clone this repository to your own GitHub account
If you want to deploy to a basic GitHub domain name, do the following to src/config/site/config.js
:
origin: 'https://grantbirki.github.io', // Change this to your GitHub username
basePathname: '/astrowind', // Change this to your repository name
If you want to use your own custom domain name, do the following to src/config/site/config.js
:
origin: 'https://astro-demo.birki.io', // Change this to your custom domain name make sure it points to your GitHub Pages domain
basePathname: '/', // leave this as a single /
Ensure you have configured GitHub Pages to use the GitHub Actions deployment option. When you push
changes to your repository, GitHub will automatically build and deploy your site.
This template also comes bundled with the branch-deploy Action. Please ensure you view the branch-deploy.yml
file and make any necessary changes if you wish to use it.
The branch-deploy
Action will allow you to trigger branch deployments from pull requests by using comments such as .deploy
.
This templates also uses a custom GitHub Actions build cache to help speed things up in CI when processing images. If you make any changes to images when working on a project using this template, please ensure to run npm run build
before deploying to ensure your cache.json
file is updated.
You should probably do a search through this repo and replace all occurances of astro-demo.birki.io
with your own domain as well.
This section goes into details on how you can make changes to the template.
Actual examples in the form of commits to this repository:
This theme is based off the template by onwidget