- Introduction
- Features
- Prerequisites
- Getting Started
- Starter Files
- Packages & Pre-Configurations
- Additional Useful Resources
- Sources
- Contributing
- License
- Support
Astro is a modern front-end framework designed to help developers build faster websites with less client-side JavaScript. This minimalistic starter template is tailored to help you kickstart your Astro project quickly and efficiently, focusing on essential features and configurations.
Explore more advanced templates at the official astro theme page.
- Pre-configured Astro JS Environment: Set up with the necessary configurations to start building right away.
- Optimized for Performance: Minimalistic design and compression for blazing-fast load times.
- SEO Friendly: Structured for optimal search engine visibility.
- Pre-Configured Deployment: Deployment to Github Pages is preconfigured with a Github Action workflow file.
Before you begin, ensure you have Node.js (version 20.9.0 or later) installed on your machine.
Start by cloning the repository and installing dependencies:
git clone https://github.com/SteinCodeAT/astro-starter-template.git
cd astro-starter-template
npm installBefore launching the development server, ensure you:
- Replace the site-name in
astro.config.mjswith your domain and remove or update thebasevariable. - Populate
src/const.jswith your site's metadata and social links. - Replace the
logo.svginsrc/iconsand the placeholder image insrc/img.
Run npm run dev to start the Astro development server. Your site will be available at localhost:4321.
If you merge your changes to the main branch of your repository the pre-configured github action will attempt to build and deploy your app to the Github Pages associated with your repository.
To learn more about Github Pages and how to enable it check out the main documentation by github: https://docs.github.com/en/pages
To build your project for production, run:
npm run buildThis will generate a static build of your project in the dist/ directory. You can deploy this build to any static hosting service using for instance FTP.
The project contains a few minimalistic starter components and files to kickstart your development.
src/components/: Reusable components.
BaseHead.astrocontains all necessary html head tags. Configure them according to your needs.Header.astrocontains the navigation. It is preconfigured with a few standard links and a mobile version.Footer.astrocontains a footer component with basic links and a copyright notice.
astro.config.mjs: Astro configuration file.
.eslintrc.cjs: Eslint configuration file.
.prettierrc.mjs: Prettier configuration file.
This template comes pre-configured with essential packages and settings optimized for performance, development ease, and best practices in web standards.
Compresses HTML, CSS, and image files out-of-the-box, ensuring your site loads quickly by reducing file sizes with no additional setup required.
astro-icons is used to load local svg-icons from src/icons and iconfiy icon sets. The icon set material design icons was already added and can be used by specifiying the name of the icon with the prefix mdi: like this
<Icon name="mdi:user" />You can find more icon sets here and add them by installing the corresponding icon set package for iconfiy
npm install @iconify-json/mdiGenerates a sitemap automatically on build, improving your SEO by making sure search engines can easily index your site's pages.
- Prettier is configured for consistent code formatting across your project.
- ESLint ensures code quality and catches JavaScript errors before they go live.
- Husky manages pre-commit hooks, running Prettier and ESLint to maintain code standards with each commit.
In the folder .github\.workflows\ the file deploy.yml contains all configurations needed to automatically build and deploy your application on github pages on any change to the main branch. This process can also be triggered manually within Github.
Building a good website is difficult as it encompasses a lot of topics such as performance, accessibility and asthetics. The following links and resources provided us with tremendous insights and helped us in our journey.
| Name | Description | Link |
|---|---|---|
| HTML Boilerplate | This excellent article by Manuel Matuzović shows his boilerplate HTML 5 template with detailled explanations on each tag | https://www.matuzo.at/blog/html-boilerplate/ |
| Default CSS | A great default css file defining base variables and styles to start your project | https://github.com/HermanMartinus/bearblog/... |
| SVGCo.de | Transform any image to svg in your browser | https://svgco.de/ |
CSS: The global.css file located in src/styles is inspired by Bear Blog's default CSS.
Image and Brand icon: The placeholder image located in src/img and the brand svg in src/icons were created using DALL-E and are meant for illustrational and demonstrational purposes only.
Contributions are welcome! Please feel free to submit a pull request or open an issue if you have suggestions for improvements.
This project is open source and available under the MIT License.
If you need help or have any questions, please open an issue for support.
