This is the official website for Swift Base, built with SvelteKit and designed for deployment to GitHub Pages with automatic custom domain detection.
- 🚀 SvelteKit with static site generation
- 🎨 Tailwind CSS for styling
- 📱 Responsive design with dark/light mode
- 🔧 TypeScript support
- 📦 Custom YAML content system
- 🌐 Automatic GitHub Pages deployment
- 🏠 Smart custom domain detection
- Use this template to create your repository
- Clone your new repository
- Install dependencies:
npm install
- Start development server:
npm run dev
This template automatically deploys to GitHub Pages and intelligently detects whether you're using a custom domain or the default GitHub Pages subdirectory.
No additional setup required! The template will automatically:
- Detect that no custom domain is configured
- Set the correct base path for subdirectory deployment
- Deploy to
https://yourusername.github.io/your-repo-name/
-
Add your domain to a
CNAMEfile in thestatic/directory:static/CNAMEContent should be just your domain:
yourdomain.com -
Configure GitHub Pages:
- Go to your repository settings
- Navigate to "Pages" section
- Set source to "GitHub Actions"
- Add your custom domain in the "Custom domain" field
The template will automatically:
- Detect the
CNAMEfile exists - Set the base path to root for custom domain deployment
- Deploy to your custom domain
The deployment workflow automatically detects your setup:
- name: Detect deployment type
run: |
if [ -f "static/CNAME" ]; then
echo "Custom domain detected - deploying to root path"
echo "base_path=" >> $GITHUB_OUTPUT
else
echo "GitHub Pages subdirectory - deploying to /repo-name"
echo "base_path=/repo-name" >> $GITHUB_OUTPUT
finpm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run check- Run SvelteKit sync and type checkingnpm run lint- Run ESLintnpm run typecheck- TypeScript type checking
src/
├── lib/
│ ├── components/ # Svelte components
│ ├── content.ts # Content loading utilities
│ └── types.ts # TypeScript interfaces
├── routes/ # SvelteKit file-based routing
│ ├── +layout.svelte # Root layout
│ └── +page.svelte # Homepage
├── app.html # HTML template
└── app.css # Global styles
content/ # YAML content files
static/ # Static assets
Content is managed through YAML files in the content/ directory:
content/index.yml- Homepage contentcontent/examples.yml- Code examplescontent/news.yml- News and updatescontent/packages.yml- Package ecosystem
This template uses:
- Tailwind CSS for utility-first styling
- Custom design system with orange primary color
- Dark/light mode support
- Heroicons and other icon sets via Iconify
Edit the YAML files in the content/ directory to customize your site content.
Update the color scheme in tailwind.config.ts:
colors: {
primary: colors.orange, // Change to your preferred color
gray: colors.zinc,
}Create new pages by adding +page.svelte files in the src/routes/ directory following SvelteKit's file-based routing.
If you're getting 404 errors for JavaScript files:
- Check if you have a custom domain: If yes, ensure you have a
CNAMEfile instatic/ - Verify GitHub Pages settings: Make sure source is set to "GitHub Actions"
- Check deployment logs: Look for BASE_PATH detection messages in Actions logs
- Port already in use: Change the port with
npm run dev -- --port 3001 - Type errors: Run
npm run checkto identify TypeScript issues - Linting errors: Run
npm run lintto check code style
MIT License - feel free to use this template for your projects!