This is the open source code for Alkemical Development's website (alkem.dev), which is built with Astro. It's a lightweight static site, that uses simple semantic HTML and a handful of custom components.
Feel free to copy, modify, and use it for your own site.
- Deploy your Astro Site to GitHub Pages
- Alkemical Development (alkem.dev): this project in action
- Astro Documentation: the static site generator used to build this site
- KaTeX: rendering math formulas and LaTeX in the browser
- Jam Icons: free vector icons (SVGs)
- Astro Icons: Astro components for icons
- Normalize.css: a modern, HTML5-ready alternative to CSS resets
- HTML Semantic Elements (W3 Schools)
First, ensure you have NodeJS+NPM installed.
Then, install dependencies:
npm install
Now, you should be ready to start using it!
To start the local development server, run:
npm run dev
> alkem-dev@0.0.1 dev
> astro dev
...
┃ Local http://localhost:4321/
┃ Network use --host to expose
By default, the site is only visible on your machine. To make it visible to other devices on your network, use the --host
flag (make sure to add an extra --
, too):
npm run dev -- --host
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: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 |
Inside of your Astro project, you'll see the following folders and files:
├── public/
├── src/
│ ├── components/
│ ├── content/
│ ├── layouts/
│ └── pages/
├── astro.config.ts
├── README.md
├── package.json
└── tsconfig.json
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.
The src/content/
directory contains "collections" of related Markdown and MDX documents. Use getCollection()
to retrieve posts from src/content/blog/
, and type-check your frontmatter using an optional schema. See Astro's Content Collections docs to learn more.
Any static assets, like images, can be placed in the public/
directory.