# Gym website

A free gym website template built with Astro and TypeScript that publishes as a static site, for independent gyms, fitness studios and personal training studios. It covers a live open and staffed-hours line, a free day pass form, memberships with a comparison table that works on phones, a class timetable filtered by day and class type, a page per class, personal trainers, facilities, corporate memberships and an FAQ, all edited in YAML and Markdown.

- Framework: Astro (JavaScript)
- Category: Websites / Fitness and sport
- Creates: a static site
- Plan: Free
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/websites/fitness-and-sport/gym-website-template
- Updated: 2026-11-21

## Features

- Live line such as "Open 24/7. Staffed now until 9pm", or plain opening hours for gyms that are not open 24 hours
- Class timetable from one YAML file, filtered by day and class type, with shareable filter links, off-peak labels and Book links
- A page per class with level, length, intensity, coaches and when it runs, with Event structured data and a weekly schedule
- Memberships with no-contract and 12-month prices, joining fee and a What is included table that becomes a two-plan comparison on phones
- Free day pass form that checks the day and time against staffed hours and bank holidays, then posts to any endpoint or opens the visitor's email app
- Personal trainers with specialisms, qualifications, classes and days, plus PT prices, facilities and corporate memberships
- ExerciseGym JSON-LD with hours, staffed reception hours and every membership price, plus FAQPage, BreadcrumbList, sitemap.xml and /llms.txt
- WCAG 2.2 AA in light and dark mode, checked with axe-core on every page, with unit tests and a smoke test of the built site

## What you need

- Free plan: it builds to a static site, which the Free plan hosts with no limit on sites
- To run it locally: Node.js 22.12 or later and npm
- Optional: PUBLIC_PASS_ENDPOINT, a Formspree or similar URL for the free day pass form; without it the form opens the visitor's email app
- Optional: PUBLIC_BOOKING_URL and PUBLIC_JOIN_URL, your class booking and online joining pages from your gym software
- Optional: SITE_URL, your public address for canonical links, the sitemap and sharing images

## About

Every gym detail lives in content/: gym.yaml for the name, address, opening and staffed hours, bank holidays, booking and joining links, memberships.yaml for prices, timetable.yaml for one line per weekly class, one Markdown file per class and per trainer, and YAML for facilities, personal training, reviews and the FAQ. At build time Astro checks that every timetable line points at a real class and coach, so a typo stops the build with the file and field named. The same hours code writes the hours tables, the ExerciseGym structured data and the live staffed-now line, so they never disagree. Start by replacing Newcastle Fitness Studio in content/gym.yaml, delete the sample reviews and put your photos in src/assets/images/. Each push to your copy redeploys, so adding a class or changing a price is a commit.

## Questions

### How do I make a website for my gym?

Deploy this template, then edit the files in content/: your gym's name, address and hours, memberships and prices, the weekly class timetable, classes and coaches. Each file is plain text with comments on every field, and the site rebuilds from them.

### How do I show a class timetable on my gym website?

Write one line per weekly class in content/timetable.yaml with the day, time, class, coach and room. The site builds a timetable visitors can filter by day and class type, a page per class with its sessions, and Event structured data with a weekly schedule.

### Can I link the Book buttons to Glofox, TeamUp or Mindbody?

Yes. Paste your booking page link into booking.url in content/gym.yaml or the PUBLIC_BOOKING_URL environment variable, and every Book button goes there. A single class can have its own bookingUrl.

### Does the gym template work for a gym that is not open 24 hours?

Yes. Set open24h: false in content/gym.yaml and the staffed hours become the opening hours everywhere: the live "Open now until 9pm" line, the hours tables and the structured data.

### Can I host this gym website without Light Cloud?

Yes. Run npm run build and upload dist/ to any static host; every page is a real HTML file, such as dist/classes/spin/index.html, so no SPA fallback is needed. Set the environment variables in the host's build settings.
