Welcome to Links, a website built with Astro.js and styled with Tailwind CSS. This project provides a modern, fast, and customizable solution for developers and creators to showcase their links and social profiles on a single page.
Why this project?
- β‘ Ultra-fast - Built with Astro for minimal JavaScript and blazing performance
- π¨ Fully customizable - Easy to change colors, fonts, links, and layout
- π± Responsive - Works beautifully on all device sizes
- π Easy deployment - Deploy to GitHub Pages, Vercel, Netlify, or any static host
- π» Developer-friendly - Content managed via JSON files, no database needed
- Clone the repository:
git clone https://github.com/pruthivithejan/links.git
cd links- Install dependencies:
bun install
# or
bun i- Start the development server:
bun run dev
# or
bun devOpen http://localhost:4321 in your browser to see your site.
Edit src/content/personal/profile.json to update your personal information:
{
"heading": "Your Name | Links",
"slogan": {
"words": "Your main text",
"highlight": "highlighted part"
},
"githubUsername": "your-github-username",
"codeRepository": "links",
"ga4": "G-XXXXXXXXXX"
}Fields explained:
heading: Appears in the browser tab and page titleslogan.words: Main slogan textslogan.highlight: Part of the slogan that gets highlighted (shown in different styling)githubUsername: Used to fetch your GitHub avatar automaticallycodeRepository: Repository name (used for GitHub Pages deployment)ga4: (Optional) Google Analytics 4 tracking ID
Edit src/content/links/links.json to add, remove, or modify your links:
[
{
"href": "https://your-website.com",
"icon": "link",
"title": "Personal Website",
"description": "Your website description"
},
{
"href": "https://github.com/yourname",
"icon": "github",
"title": "GitHub",
"description": "Check out my projects"
}
]Fields explained:
href: The URL the link points toicon: Icon name (must match an SVG file inpublic/- see Adding Icons)title: Link title displayed on the carddescription: Short description of the link
Each section has its own JSON list. Add any URL to the section you want, in the order you want it displayed:
src/content/quick-links/quick-links.json: Compact header links withhref,icon, andlabel.src/content/links/links.json: Simple cards withhref,icon,title, and your owndescription.src/content/link-cards/link-cards.json: Rich previews withhref,icon, andtitle.
For example, a rich preview only needs:
[
{
"href": "https://github.com/yourname",
"icon": "github",
"title": "GitHub"
}
]Rich previews select a component from the URL. GitHub, X, LinkedIn, Facebook, and Instagram have profile components; other URLs use a website preview. Removing a link from your lists keeps those components available for anyone else. An empty list hides that section.
bun run build fetches public metadata for all three lists and stores it in src/data/link-card-previews.json. Run bun run prebuild to refresh previews during development. Avatars and media use remote URLs; there are no downloaded profile images to maintain. GitHub profiles and contributions use their APIs, X uses FxTwitter, and other sites use Open Graph and structured metadata from their public pages.
When a site blocks fetching, the build keeps any previously fetched metadata for that URL. Without cached details, the card uses an avatar fetched for another configured link and hides unavailable bios, locations, and stats. It never copies another profile's details. If no avatar is available, the component keeps its initials or icon. Removed links are pruned from the cache, and duplicate URLs are fetched once.
The project comes with custom fonts loaded locally from public/fonts/:
/* From src/styles/global.css */
@font-face {
font-family: "Switzer-Regular";
src: url("/fonts/Switzer-Regular.woff2") format("woff2");
font-weight: 400;
font-display: swap;
}To use your own fonts:
- Place font files (
.woff2,.ttf,.otf) inpublic/fonts/ - Update
src/styles/global.csswith your@font-facedeclarations - Update the
font-familyreferences in the:rootstyles
To use Google Fonts instead:
- Go to Google Fonts
- Select your desired fonts and copy the import link
- Add to
src/styles/global.css:
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@layer base {
body {
font-family:
"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
}Colors are defined using OKLCH color space for modern, perceptually uniform colors. Edit src/styles/global.css:
@layer base {
:root {
/* Light mode colors */
--callout-rgb: 238, 240, 241;
--card-rgb: 180, 185, 188;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}
html.dark {
/* Dark mode colors */
--callout-rgb: 20, 20, 20;
--card-rgb: 100, 100, 100;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
html {
background: linear-gradient(to bottom, oklch(0.86 0.005 283), oklch(1 0 0));
}
}Quick color changes:
- Background gradient: Modify the
oklch()values in thebackgroundproperty - Text color: Update the
colorproperty inbody - Card background: Edit
--card-rgbvalues - Dark mode: Add/modify values in
html.darkselector
Icons are stored as SVG files in the public/ directory. To add new icons:
- Download SVG icons from Iconify or Feather Icons
- Save the SVG file to
public/with a simple name (e.g.,youtube.svg) - Reference the icon name (without
.svg) in your links JSON:
{
"href": "https://youtube.com/@yourname",
"icon": "youtube",
"title": "YouTube"
}src/
βββ components/
β βββ Hero.astro # Hero section with profile
β βββ Links.astro # Links card grid
βββ content/
β βββ config.ts # Content collection schema
β βββ links/
β β βββ links.json # Your links data
β βββ personal/
β βββ profile.json # Your profile data
βββ layouts/
β βββ Layout.astro # Main layout wrapper
βββ pages/
β βββ index.astro # Home page
βββ styles/
βββ global.css # Global styles & fonts
- Enable GitHub Pages in repository settings
- Go to Settings β Pages β Build and deployment
- Select Deploy from a branch and choose
mainbranch,/rootfolder
For more details, see Astro GitHub Pages Deployment Guide.
If you see a blank page after deploying:
- Check browser console for errors (F12)
- Verify
astro.config.mjshas correctbasepath - Clear browser cache and hard refresh (Cmd+Shift+R on Mac)
- Check Astro Deployment Guide
- Verify SVG files are in
public/folder - Check icon names in
links.jsonmatch filename (without.svg) - Ensure SVG files are valid (open in browser to test)
- Check
@font-faceURLs are correct insrc/styles/global.css - Verify font files exist in
public/fonts/ - Clear browser cache and restart dev server
bun run dev # Start development server
bun run build # Build for production
bun run preview # Preview production buildFound a bug or have a feature idea? Feel free to open an issue or submit a pull request!
β¨ If you found this project helpful, please leave a star on GitHub! β¨