""" Lahr Carpet Cleaning — Location page generator. Creates /locations//index.html for each city. Run: python3 tools/gen-locations.py """ import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) LOC_DIR = os.path.join(BASE_DIR, "locations") CITIES = [ {"name": "Waterloo", "slug": "waterloo-ny", "county": "Seneca County", "note": "Our home base. Fastest response times in the area."}, {"name": "Geneva", "slug": "geneva-ny", "county": "Ontario County", "note": "Full residential and commercial services throughout Geneva."}, {"name": "Seneca Falls", "slug": "seneca-falls-ny", "county": "Seneca County", "note": "Serving homes, vacation rentals, and businesses in Seneca Falls."}, {"name": "Canandaigua", "slug": "canandaigua-ny", "county": "Ontario County", "note": "Lakefront homes, rentals, and businesses along Canandaigua Lake."}, {"name": "Penn Yan", "slug": "penn-yan-ny", "county": "Yates County", "note": "Homes, wineries, and short-term rentals in the Penn Yan area."}, {"name": "Newark", "slug": "newark-ny", "county": "Wayne County", "note": "Carpet and upholstery cleaning for homes and businesses in Newark."}, {"name": "Clifton Springs", "slug": "clifton-springs-ny", "county": "Ontario County", "note": "Residential and commercial cleaning throughout Clifton Springs."}, {"name": "Lodi", "slug": "lodi-ny", "county": "Seneca County", "note": "Serving homes and vacation properties in Lodi and surrounding areas."}, {"name": "Himrod", "slug": "himrod-ny", "county": "Yates County", "note": "Carpet and floor cleaning for homes and rentals in the Himrod area."}, {"name": "Phelps", "slug": "phelps-ny", "county": "Ontario County", "note": "Residential carpet and upholstery cleaning throughout Phelps."}, {"name": "Shortsville", "slug": "shortsville-ny", "county": "Ontario County", "note": "Home and business cleaning services in Shortsville, NY."}, {"name": "Victor", "slug": "victor-ny", "county": "Ontario County", "note": "Residential and commercial carpet cleaning throughout Victor."}, {"name": "Naples", "slug": "naples-ny", "county": "Ontario County", "note": "Serving homes, wineries, and vacation rentals in the Naples area."}, {"name": "Gorham", "slug": "gorham-ny", "county": "Ontario County", "note": "Carpet and floor cleaning for homes and properties in Gorham."}, {"name": "Manchester", "slug": "manchester-ny", "county": "Ontario County", "note": "Residential and commercial cleaning services in Manchester, NY."}, {"name": "Ovid", "slug": "ovid-ny", "county": "Seneca County", "note": "Serving homes and rental properties throughout Ovid."}, {"name": "Clyde", "slug": "clyde-ny", "county": "Wayne County", "note": "Carpet, upholstery, and floor cleaning for homes and businesses in Clyde."}, {"name": "Farmington", "slug": "farmington-ny", "county": "Ontario County", "note": "Residential and commercial carpet cleaning throughout Farmington."}, {"name": "East Bloomfield", "slug": "east-bloomfield-ny", "county": "Ontario County", "note": "Serving homes and properties in East Bloomfield and surrounding areas."}, {"name": "Rushville", "slug": "rushville-ny", "county": "Yates County", "note": "Carpet and upholstery cleaning for homes and rentals in Rushville."}, {"name": "Finger Lakes", "slug": "finger-lakes-ny", "county": "Region", "note": "Serving vacation rentals, wineries, and homes across the Finger Lakes region."}, ] SERVICES = [ {"name": "Carpet Cleaning", "slug": "/services/carpet-cleaning/", "img": "/assets/images/services/carpet-cleaning.jpg", "sub": "In-Home Service", "desc": "Hot water extraction removes deep-seated dirt, allergens, and stains from carpet fibers throughout your home."}, {"name": "Stairs Cleaning", "slug": "/services/stairs/", "img": "/assets/images/services/stairs-cleaning.jpg", "sub": "Step by Step", "desc": "Stairs collect more dirt per square inch than any flat surface. We clean every tread, riser, and landing."}, {"name": "Upholstery Cleaning","slug": "/services/upholstery/", "img": "/assets/images/services/upholstery-cleaning.jpg","sub": "Furniture Refresh", "desc": "Safe, effective cleaning for sofas, chairs, and mattresses. We work with all fabric types and leave no residue."}, {"name": "Floor Cleaning", "slug": "/services/floors/", "img": "/assets/images/services/floor-cleaning.jpg", "sub": "Hard Surface Care", "desc": "Wood floor cleaning and tile and grout restoration that brings hard surfaces back to their original condition."}, {"name": "Area Rug Cleaning", "slug": "/services/area-rugs/", "img": "/assets/images/services/area-rug-cleaning.jpg", "sub": "Delicate Care", "desc": "Gentle, specialized cleaning for oriental, Persian, and delicate rugs that restores color and removes embedded dirt."}, {"name": "Add-On Services", "slug": "/services/add-ons/", "img": "/assets/images/services/add-ons.jpg", "sub": "Extra Care", "desc": "Furniture moving, pet hair removal, odor treatment, and heavily soiled area care available alongside any service."}, ] HERO_IMAGES = [ "/assets/images/hero/hero-living-room.jpg", "/assets/images/hero/hero-clean-result.jpg", "/assets/images/hero/hero-technician.jpg", "/assets/images/hero/hero-before-after.jpg", "/assets/images/hero/hero-stairs.jpg", ] def service_card(svc, city_name): accent_word, rest = svc["name"].split(" ", 1) if " " in svc["name"] else (svc["name"], "") h3 = f'{accent_word} {rest}'.strip() return f"""
{svc['name']} in {city_name}, NY

{h3}

{svc['sub']}

{svc['desc']}

Learn More
""" def page_html(city, idx): hero_img = HERO_IMAGES[idx % len(HERO_IMAGES)] cards = "\n".join(service_card(s, city["name"]) for s in SERVICES) name = city["name"] county = city["county"] note = city["note"] slug = city["slug"] return f""" Carpet Cleaning in {name}, NY | Lahr Carpet Cleaning
{county} — Finger Lakes

{name},
NY

{note}

Services in {name}

We serve {name} and the surrounding {county} communities. Call to confirm availability for your address.

{cards}

Serving {name}

Call 315-719-1218 or submit the form for a free estimate in {name}, NY.

Get a Free Estimate
""" def locations_index(): city_cards = [] for i, city in enumerate(CITIES): img = HERO_IMAGES[i % len(HERO_IMAGES)] name = city["name"] county = city["county"] note = city["note"] slug = city["slug"] if " " in name: accent_word, rest = name.split(" ", 1) h3 = f'{accent_word} {rest}, NY' else: h3 = f'{name}, NY' city_cards.append(f"""
{name} NY

{h3}

{county}

{note}

View Services
""") cards_html = "\n".join(city_cards) return f""" Service Areas | Lahr Carpet Cleaning | Finger Lakes, NY
Finger Lakes Region

Service
Areas

We clean carpets, upholstery, rugs, and hard floors across 21 cities in Upstate New York. Select your city below.

Cities We Serve

Based in Waterloo, NY. We travel throughout Seneca, Ontario, Yates, Wayne, and Cayuga counties.

{cards_html}

Not sure if we cover your area?

Call 315-719-1218 or submit the form and we will confirm availability for your address.

Get a Free Estimate
""" if __name__ == "__main__": # Write locations index with open(os.path.join(LOC_DIR, "index.html"), "w") as f: f.write(locations_index()) print("Wrote locations/index.html") # Write each city page for i, city in enumerate(CITIES): city_dir = os.path.join(LOC_DIR, city["slug"]) os.makedirs(city_dir, exist_ok=True) out_path = os.path.join(city_dir, "index.html") with open(out_path, "w") as f: f.write(page_html(city, i)) print(f"Wrote locations/{city['slug']}/index.html") print(f"\nDone. {len(CITIES)} city pages + index generated.")