Skip to content

Commit 0cd52cc

Browse files
committed
Migrate Gatsby to Astro, add ESLint and update build config
1 parent 030c486 commit 0cd52cc

25 files changed

Lines changed: 11019 additions & 31034 deletions

.eslintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 🚀 Build and deploy Astro
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch: # Allows manual trigger
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0 # Not needed if lastUpdated is not enabled
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version: 22
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint code
28+
run: npm run analyze
29+
30+
- name: Build with Astro
31+
run: npm run build
32+
33+
- name: Deploy to dist branch
34+
uses: peaceiris/actions-gh-pages@v4
35+
with:
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
publish_dir: ./dist
38+
publish_branch: dist
39+
force_orphan: true # Keeps the dist branch clean without history

.gitignore

Lines changed: 8 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,24 @@
1-
# Based on gatsby-starter-default's .gitignore
2-
# https://github.com/gatsbyjs/gatsby-starter-default/blob/master/.gitignore
1+
# Astro build output
2+
dist/
3+
.astro/
4+
5+
# Dependencies
6+
node_modules/
37

48
# Logs
5-
logs
69
*.log
710
npm-debug.log*
811
yarn-debug.log*
912
yarn-error.log*
1013

11-
# Runtime data
12-
pids
13-
*.pid
14-
*.seed
15-
*.pid.lock
16-
17-
# Directory for instrumented libs generated by jscoverage/JSCover
18-
lib-cov
19-
20-
# Coverage directory used by tools like istanbul
21-
coverage
22-
23-
# nyc test coverage
24-
.nyc_output
25-
26-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27-
.grunt
28-
29-
# Bower dependency directory (https://bower.io/)
30-
bower_components
31-
32-
# node-waf configuration
33-
.lock-wscript
34-
35-
# Compiled binary addons (http://nodejs.org/api/addons.html)
36-
build/Release
37-
38-
# Dependency directories
39-
node_modules/
40-
jspm_packages/
41-
42-
# Typescript v1 declaration files
43-
typings/
44-
45-
# Optional npm cache directory
46-
.npm
47-
48-
# Optional eslint cache
49-
.eslintcache
50-
51-
# Optional REPL history
52-
.node_repl_history
53-
54-
# Output of 'npm pack'
55-
*.tgz
56-
57-
# dotenv environment variable files
14+
# Environment variables
5815
.env*
5916

60-
# gatsby files
61-
.cache/
62-
public
63-
64-
# Mac files
17+
# OS files
6518
.DS_Store
6619

6720
# Yarn
6821
yarn-error.log
6922
.pnp/
7023
.pnp.js
71-
72-
# Yarn Integrity file
7324
.yarn-integrity

.prettierignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
.cache
1+
node_modules
2+
dist
3+
.astro
24
package.json
35
package-lock.json
4-
public
6+
.env*
7+
*.log
8+
.DS_Store

.prettierrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"printWidth": 100,
3+
"semi": true,
4+
"singleQuote": false,
5+
"tabWidth": 2,
6+
"trailingComma": "es5",
7+
"plugins": ["prettier-plugin-astro"],
8+
"overrides": [
9+
{
10+
"files": "*.astro",
11+
"options": {
12+
"parser": "astro"
13+
}
14+
}
15+
]
16+
}

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Keycapsss Link Site
2+
3+
A static site built with Astro and Tailwind CSS. A simple link tree for the Keycapsss mechanical keyboard shop.
4+
5+
## Getting Started
6+
7+
### Prerequisites
8+
- Node.js 18+
9+
- npm or yarn
10+
11+
### Installation
12+
13+
```bash
14+
npm install
15+
```
16+
17+
## Available Scripts
18+
19+
### Development
20+
- **`npm run dev`** - Start the local development server with hot reload (http://localhost:4321/)
21+
- **`npm run preview`** - Preview the production build locally before deployment
22+
23+
### Build
24+
- **`npm run build`** - Create an optimized production build (outputs to `dist/`)
25+
26+
### Code Quality
27+
28+
#### Linting & Formatting
29+
- **`npm run analyze`** - Run both Prettier and ESLint checks (reports issues without fixing)
30+
- **`npm run analyze:prettier`** - Check code formatting with Prettier
31+
- **`npm run analyze:eslint`** - Check code quality with ESLint
32+
33+
#### Auto-fixing
34+
- **`npm run fix`** - Auto-fix all code formatting and linting issues
35+
- **`npm run fix:prettier`** - Auto-format code with Prettier
36+
- **`npm run fix:eslint`** - Auto-fix ESLint violations
37+
38+
## Project Structure
39+
40+
```
41+
src/
42+
├── pages/
43+
│ └── index.astro # Main landing page
44+
├── layouts/
45+
│ └── Layout.astro # Base layout with styling
46+
public/
47+
├── favicon.svg # SVG favicon
48+
├── favicon.png # PNG favicon
49+
└── keycapsss-logo.svg # Site logo
50+
```
51+
52+
## Technologies
53+
54+
- **Framework:** Astro 5.16.5
55+
- **Styling:** Tailwind CSS 3.0.24
56+
- **Code Quality:** ESLint + Prettier
57+
- **Deployment:** Static site (outputs to `dist/`)
58+
59+
## Deployment
60+
61+
This project builds to a `dist/` folder suitable for static hosting (Coolify, Netlify, Vercel, GitHub Pages, etc.).
62+
63+
```bash
64+
npm run build # Creates dist/ folder
65+
```
66+
67+
## License
68+
69+
MIT

astro.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from 'astro/config';
2+
import tailwind from '@astrojs/tailwind';
3+
4+
export default defineConfig({
5+
integrations: [tailwind()],
6+
outDir: './dist',
7+
vite: {
8+
build: {
9+
minify: 'terser',
10+
},
11+
},
12+
});

eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import js from "@eslint/js";
2+
import astro from "eslint-plugin-astro";
3+
import astroParser from "astro-eslint-parser";
4+
import tsParser from "@typescript-eslint/parser";
5+
6+
export default [
7+
{
8+
ignores: ["dist/**", ".astro/**", "node_modules/**"],
9+
},
10+
js.configs.recommended,
11+
...astro.configs.recommended,
12+
{
13+
files: ["**/*.astro"],
14+
languageOptions: {
15+
parser: astroParser,
16+
parserOptions: {
17+
parser: tsParser,
18+
sourceType: "module",
19+
},
20+
},
21+
},
22+
{
23+
files: ["**/*.js"],
24+
languageOptions: {
25+
sourceType: "module",
26+
globals: {
27+
console: "readonly",
28+
process: "readonly",
29+
},
30+
},
31+
},
32+
];

gatsby-browser.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)