GrantBirki / astrowind-hard-fork

Template repo for AstroWind on GitHub pages - Heavily favoring js config files

Home Page:https://astro-demo.birki.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚀 AstroWind

deploy ci lint CodeQL

This is a custom AstroWind template for deployment to GitHub pages

example

The original AstroWind template can be found here: source

⚠️ Due to how fast the upstream source project has been moving and with how fast the Astro project has been moving, I am abandoning this fork. ⚠️

Features

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.

Full Offline Development Support

After running npm i and npm run dev for the first time, you can develop your site completely offline!

Config Files

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:

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.

Commands

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

Development

Here are some basic commands to get you up and running to develop with this template:

  1. Install npm dependencies

    npm i
  2. Start the development server

    npm run dev
  3. View your site at localhost:3000

Live reload is enabled by default, so any changes you make will be reflected in the browser.

Deployment

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.

Branch Deploy

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.

Build Cache

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.

Using this Template

You should probably do a search through this repo and replace all occurances of astro-demo.birki.io with your own domain as well.

Making Changes

This section goes into details on how you can make changes to the template.

Live Commit Examples

Actual examples in the form of commits to this repository:

Acknowledgements

This theme is based off the template by onwidget

About

Template repo for AstroWind on GitHub pages - Heavily favoring js config files

https://astro-demo.birki.io/

License:MIT License


Languages

Language:Astro 58.9%Language:JavaScript 23.0%Language:MDX 10.4%Language:TypeScript 6.7%Language:CSS 1.0%Language:Shell 0.0%