This is the source code for my personal website, built with SvelteKit and Tailwind CSS.
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the site: Navigate to
http://localhost:5173.
The site is configured as a static site using @sveltejs/adapter-static.
The site is automatically deployed to GitHub Pages via a GitHub Action (.github/workflows/deploy.yml) whenever changes are pushed to the main branch.
- Go to your repository on GitHub.
- Navigate to Settings > Pages.
- Under Build and deployment > Source, select GitHub Actions. This tells GitHub to use the deployment workflow we've created instead of looking for a branch.
If you want to use a custom domain (e.g., collado-ruiz.es):
-
In GitHub:
- Go to Settings > Pages.
- Under Custom domain, enter your domain name and click Save.
- This will create a
CNAMEfile in your repository (or you can manually add it to thestatic/folder to ensure it persists across builds).
-
In your DNS Provider (e.g., Namecheap, Cloudflare):
- For a subdomain (e.g.,
www.yourdomain.com): Create aCNAMErecord pointing toyourusername.github.io. - For an apex domain (e.g.,
yourdomain.com): CreateArecords pointing to GitHub's IP addresses:185.199.108.153185.199.109.153185.199.110.153185.199.111.153
- It is also recommended to set up a
WWWredirect orALIAS/ANAMErecords if your provider supports them.
- For a subdomain (e.g.,
-
Wait for Propagation: DNS changes can take up to 24-48 hours to propagate. Once ready, you can enable Enforce HTTPS in the GitHub Pages settings.
To build the static site locally:
npm run buildThe output will be in the build/ directory.
src/routes/: Contains the pages and layouts. Markdown files are used for content (via mdsvex).src/lib/: Reusable Svelte components (Hero, NavCard, Image, Tabs, etc.).static/: Static assets like images and favicons.scripts/: Utility scripts, such asfetch_blogposts.js.
The site can include blog posts from external sources (e.g., Earthster). These are stored in src/lib/external_posts.json.
To fetch the latest posts from configured sources, run:
npm run fetch_blogpostsThis script will only add new posts and will not remove existing ones.