Content Audit
Extract and inventory all content from your existing site.
Goal: Migrate your existing website to Astro Swiss Theme with minimal friction.
This guide walks you through migrating an existing website to the Astro Swiss Theme. Whether you’re coming from WordPress, a static site, or another framework, these steps will help you transition smoothly.
Time estimate: 4-6 hours for a complete migration
Content Audit
Extract and inventory all content from your existing site.
Setup & Configuration
Install the template and configure company information.
Content Migration
Map your data to the template structure.
Deploy
Test thoroughly and deploy to production.
Before touching any code, inventory all content from your existing website.
Create a spreadsheet or document with these sections:
Essential details:
Example structure:
Company Name: Your Company NameAddress: Street Address 123City: CH-1000 Your CityPhone: +41 XX XXX XX XXEmail: contact@example.comLinkedIn: https://www.linkedin.com/company/yourcompany/Instagram: https://www.instagram.com/yourcompany/For each service:
Example:
Service 1: Custom DevelopmentDescription: Tailored software solutions for your business needsIcon: code
Service 2: ConsultingDescription: Expert guidance for your digital transformationIcon: usersFor each person:
For each project:
Collect all assets you’ll need:
Organize your assets:
migration-assets/├── logo/│ └── company-logo.svg├── team/│ ├── person1.jpg│ └── person2.jpg├── portfolio/│ ├── project1.jpg│ └── project2.jpg└── brand-colors.txtClone the repository
# Free starter theme (public repository)git clone https://github.com/vincentheimann/astro-swiss-free-starter-theme.gitcd astro-swiss-free-starter-themeInstall dependencies
npm installStart development server
npm run devVisit http://localhost:4321 to see the template.
Extract the ZIP file
Extract the purchased astro-swiss-starter-theme-v1.0.0.zip to your desired location:
# Example: Extract to your projects folderunzip astro-swiss-starter-theme-v1.0.0.zipcd astro-swiss-starter-themeInstall dependencies
npm installStart development server
npm run devVisit http://localhost:4321 to see the template.
Track your changes with version control:
git initgit add .git commit -m "Initial commit - Astro Swiss template"Now replace the demo content with your actual company information.
File: src/consts.ts
Replace the COMPANY object with your information:
export const COMPANY: CompanyInfo = { name: "Your Company Name", address: "Your Street Address", pobox: "", // Leave empty if not used city: "CH-1000 Your City", phone: "+41 XX XXX XX XX", email: "contact@example.com", mapsUrl: "https://maps.google.com/?q=Your+Address", socials: { linkedin: "https://www.linkedin.com/company/yourcompany/", facebook: "", instagram: "", twitter: "", github: "", },};File: src/i18n/ui.ts
Update the site title, description, and business information for each language:
fr: { 'site.title': 'Your Company | Your Tagline', 'site.description': 'Your SEO-optimized description here', 'business.tagline': 'Your compelling tagline', 'business.description': 'Brief description of your business and what you do', // ... keep other translations}de: { 'site.title': 'Ihr Unternehmen | Ihr Slogan', 'site.description': 'Ihre SEO-optimierte Beschreibung hier', 'business.tagline': 'Ihr überzeugender Slogan', 'business.description': 'Kurze Beschreibung Ihres Unternehmens', // ... keep other translations}If your primary language is different from French, update:
File: astro.config.mjs
i18n: { defaultLocale: "fr", // Change to "de", "en", etc. if needed locales: ["fr", "de"], // List all languages you support routing: { prefixDefaultLocale: false, },},File: src/i18n/ui.ts
export const defaultLang: Language = 'fr'; // Match astro.config.mjsThe template includes a Services section. Let’s customize it with your offerings.
File: src/i18n/ui.ts
Update the services section for each language:
fr: { // ... other translations ... 'services.title': 'Our Services', 'services.subtitle': 'Comprehensive solutions for your needs',
'services.service1.title': 'Your Service 1', 'services.service1.description': 'Description of your first service',
'services.service2.title': 'Your Service 2', 'services.service2.description': 'Description of your second service',
// Add more services as needed}Repeat for German and any other languages.
File: src/components/ServicesSection.astro
The template uses Tabler Icons. Change icons to match your services:
const services = [ { icon: 'code', key: 'service1' }, // Development { icon: 'users', key: 'service2' }, // Consulting { icon: 'palette', key: 'service3' }, // Design { icon: 'rocket', key: 'service4' }, // Launch // ... etc];Browse available icons at Tabler Icons.
If you have team members to showcase, add them to the template.
File: src/consts.ts
Add employees to the EMPLOYEES object:
export const EMPLOYEES: Record<string, EmployeeInfo> = { ABC: { id: "ABC", name: "Alice Brown", portrait: "/images/team/alice.jpg", // Add photo to public/images/team/ email: "alice@example.com", phone: "+41 XX XXX XX XX", socials: { linkedin: "https://www.linkedin.com/in/alicebrown/", facebook: "", instagram: "", twitter: "", github: "", }, }, // Add more team members as needed};File: src/i18n/ui.ts
Add title and bio for each employee:
fr: { // ... other translations ... 'employee.ABC.title': 'Founder & CEO', 'employee.ABC.bio': 'Brief bio describing experience and expertise.',}public/images/team/Showcase your work with portfolio projects.
src/assets/portfolio/File: src/data/portfolio/fr.ts
import { nanoid } from "nanoid";import type { ImageMetadata } from "astro";
// Import your project imagesimport project1 from "../../assets/portfolio/project1.jpg";import project2 from "../../assets/portfolio/project2.jpg";
export const portfolioFr: PortfolioProject[] = [ { id: nanoid(), title: "Project Title", description: "Detailed project description.\n\nMultiple paragraphs supported.", image: project1, primaryCtaText: "View Details →", primaryCtaLink: "#", // Add link if you have a project page }, { id: nanoid(), title: "Another Project", description: "Another project description.", image: project2, }, // Add more projects...];Repeat for German (src/data/portfolio/de.ts) with translated content.
Make the template match your brand identity.
File: src/styles/tokens.css
Find the color definitions and update them:
@theme { /* Primary Brand Color */ --color-primary-50: #f0f9ff; --color-primary-100: #e0f2fe; --color-primary-500: #0ea5e9; /* Main brand color */ --color-primary-600: #0284c7; --color-primary-700: #0369a1;
/* Adjust other shades as needed */}Prepare your logo:
Add logo file:
public/images/public/images/logo.svgUpdate logo references:
File: src/components/Header.astro
<img src="/images/logo.svg" alt="Your Company Name" class="h-8 w-auto"/>Update footer logo in src/components/Footer.astro if present.
Replace public/favicon.svg with your own favicon:
The template supports French and German by default. Configure languages based on your needs:
If you want to support both French and German:
src/i18n/ui.tssrc/data/portfolio/fr.ts and de.tsIf you only need French (for example):
1. Update Astro config (astro.config.mjs):
i18n: { defaultLocale: "fr", locales: ["fr"], // Remove "de"}2. Update language definitions (src/i18n/ui.ts):
export const languages = { fr: { name: 'Français', flag: '🇫🇷' }, // Remove de: { ... }} as const;3. Remove German translations: Delete the de: { ... } section from ui.ts
4. Remove German portfolio: Delete src/data/portfolio/de.ts
5. Remove German pages: Delete src/pages/de/ folder
See the Adding Languages Guide for detailed instructions on adding support for additional languages.
The template includes a contact form. Configure it to receive submissions.
The default setup uses a mailto: link. Update the email in:
File: src/components/ContactSection.astro
<form action={`mailto:${COMPANY.email}`} method="post" enctype="text/plain">This opens the user’s email client. No server setup required.
For a better user experience, integrate with a form service:
Popular options:
Example with Formspree:
Sign up at formspree.io
Create a new form and get your form endpoint
Update the form action:
<form action="https://formspree.io/f/YOUR_FORM_ID" method="POST">Before deploying, thoroughly test your migrated site.
Go through each section and verify:
Header/Navigation
Hero Section
Services Section
Portfolio Section
Team Section (if applicable)
Contact Section
Footer
If supporting multiple languages:
/ for default, /de/ for German)Test on different screen sizes:
Use browser DevTools to test responsive breakpoints.
Run a Lighthouse audit:
Common issues:
Once testing is complete, deploy your site to production.
npm run buildThis creates an optimized production build in the dist/ folder.
Test the production build locally:
npm run previewThe template works with any static hosting provider. Popular options:
Netlify (Recommended)
npm run builddistCustom domain: Follow Netlify’s guide to add your domain.
Vercel
Other Hosts
The template works with:
See the Deployment Guide for provider-specific instructions.
Track your website traffic with Google Analytics:
G-XXXXXXXXXX)See the Analytics Guide for detailed setup instructions.
Improve your search engine visibility:
Submit sitemap to Google Search Console:
https://yourdomain.com/sitemap-index.xmlVerify Open Graph tags:
Test structured data:
Issue: “Module not found” errors
Solution:
# Delete node_modules and reinstallrm -rf node_modules package-lock.jsonnpm installPossible causes:
public/ or src/assets/Possible causes:
src/i18n/ui.tsfr, de, etc.)as const is present in ui.tsSolution:
src/styles/tokens.css has dark mode colors definedCommon causes:
Debug:
# Run build with verbose outputnpm run build -- --verboseUse this checklist to track your migration progress:
npm install)npm run dev)src/consts.ts)src/i18n/ui.ts)src/styles/tokens.css)npm run build)npm run preview)Congratulations on migrating to Astro Swiss! 🎉
Styling Guide
Advanced styling and theming options.
Customization Guide
Component customization and advanced features.
Adding Languages
Add support for more languages.
Analytics Setup
Track your visitors with GA4 and GTM.