Skip to content
vp.Ven Petrov
WorkAI demoWritingResourcesResume / CVAboutAt a glance
← Projects & notes
Astro local-services websiteProject story · 3 min read

Keeping local service pages and their FAQs consistent

A city page should only offer services enabled for that location. I used shared Astro templates with explicit availability rules, and one FAQ selection for both the visible page and its structured data.

Ven PetrovImplemented website

A local-services page needs to get two things right: what the business offers in that city and what the page tells the visitor. Reusing a template helps with layout, but it does not answer either question on its own.

In this Astro project, a Barcelona flooring page can be enabled while a painting page stays disabled. The relevant content can remain in the project without being published. I kept availability, longer page copy and shared layout in separate inputs, then used them together when assembling each page.

The same approach applies to FAQs. The questions a visitor reads and the questions described to search engines come from one selection, so the two versions stay consistent.

Barcelona can offer one service without publishing another

JSON records describe cities and services. Markdown holds the longer content for city pages, service pages and city-service pages. Shared Astro templates put those inputs together.

The route builder checks three settings: the city is active, the service is active, and that city allows the service. All three must agree before the page is generated.

The retained configuration makes the difference concrete:

Combination City active Service active City allows service Route generated
Barcelona + laminate installation Yes Yes Yes Yes
Barcelona + home painting Yes No Yes No

Barcelona and its local painting flag are enabled, but painting is globally inactive. The painting route is therefore excluded. There is no need to delete its content to stop publishing it.

For an enabled combination, the template finds the Markdown entry with matching city and service slugs, the identifiers used in URLs. That record supplies the text and metadata, with template fallbacks where content is absent.

The content collections require fields such as title, description and hero text through Zod schemas. A missing required field can be caught when the content is processed. That is a structural check; it cannot decide whether the wording is helpful or accurate.

The project contains 83 Markdown records: 66 city-service entries, 11 city entries and six service entries. These are stored-content counts. The active settings determine which routes are generated.

Replace the repeated questions with a relevant selection

The project notes describe the earlier FAQ implementation as five repeated questions with city and service names substituted. The current pool has 78 questions across ten categories, including service-specific and general questions.

For example, “¿Qué grosor de suelo laminado debo elegir para mi vivienda?” asks what thickness of laminate flooring to choose for a home. Its service association connects it to flooring. Changing a city name inside a generic question would not make that question relevant to every service.

The city-service selector asks for five questions. It takes up to three that match the service, then fills remaining places from the general questions. The city and service identifiers provide a repeatable shuffle seed, so rebuilding unchanged inputs keeps the same order.

const pageFAQs = getPageFAQs(service.slug, city.slug, 5);

I pass that array to both the visible FAQ section and generateFAQSchema(). The latter creates JSON-LD, the machine-readable description of those questions and answers.

Select the questions once

pageFAQs = getPageFAQs(service.slug, city.slug, 5)
FAQSectionVisible questions

Render the selected questions and answers.

generateFAQSchema(pageFAQs)JSON-LD

Describe those same questions in structured data.

The service and city slugs seed the selection. Rebuilding an unchanged page keeps that selection stable.

Selecting once keeps a visitor's page and its structured data aligned. Editing an answer in the pool updates both through the shared input.

The result is an implemented content system with explicit route availability and repeatable FAQ assembly. It does not guarantee unique wording on every page, and a small eligible pool can return fewer than five questions. Search performance and the quality of the answers still need their own evidence.

Project sources & checks
Local repository and code review

astro-seo-website: src/content/config.ts, src/utils/faq-utils.ts, src/data/faqs.json and src/pages/[city]/[service].astro.

Source inventory

Counted 66 city-service, 11 city and 6 service Markdown records; FAQ data contains 78 questions across 10 categories.

Scope of result

Configured content counts are not published-page counts. Routes filter active cities, active services and city-level availability; no traffic uplift is claimed.

On this page
Barcelona can offer one service without publishing anotherReplace the repeated questions with a relevant selectionSources & checks
AstroTypeScriptContent modelingSEO

Connected to this

All writing
3D Spaces website migration · Project story

Moving 3D Spaces without moving its mailbox

Sociedades Inactivas enquiries · Technical note

An enquiry should survive a failed email

Ven PetrovSoftware engineer · Barcelona
GitHub ↗LinkedIn ↗Email ↗

Find a project or a note

18 results

Transfutur ERP · ExperienceERP for transport and logisticsAs the sole engineer, I built an ERP from zero for transport and logistics. It supported roughly €5–6 million in annual invoicing across two offices, and I kept it running for about a year.Finance evidence desk · Project storyCan an AI reviewer improve a financial explanation?A finance review needs the right explanation as well as the right numbers. I tested one AI analyst, an added reviewer and self-review on the same public report. The added review produced fewer supported answers.Financial review lab · Project storyWhat contributed to an $86 million rise in operating income?I built a financial-report explorer around a question I could check: how did seven income-statement movements add up to an $86 million increase? The same source now supports comparisons of sales, cash flow and reported versus core results.MNQ time-series research · ExperimentA time-series model that failed on later dataA model gained about $2,351 in the research simulation, then lost about $1,728 in three later windows. I followed the experiment from data acquisition and time intervals to costs, evaluation and the decision to reject it for trading.Crude-oil narrative tracker · Project storyFollowing crude-oil news without losing the market numbersI used a short personal experiment to follow global events alongside crude-oil prices and position values. The prototype calculates the numbers before asking Claude Code for an assessment and keeps a limited recent history.NQ/MNQ backtest engine · Technical noteYesterday’s short was blocking today’s trades in the simulatorWhen input stopped before the scheduled close, the strategy forgot a position but a shared counter kept counting it. Closing the old position before resetting the day restored the trade record and released the block.Small-cap edge research · Project storyWhat would make a small-cap price pattern worth testing?I built a Python and DuckDB prototype to turn trading ideas into named tests, compare their costs and revisit them in later periods. The candidates deteriorated under further checks, and the source exposed a misleading pass flag.Gadgeon Europe applications · ExperienceConnected-device dashboards and mobile apps at Gadgeon EuropeThe dashboards let people monitor energy use and control connected devices through data from several APIs. My work covered customized Ionic and Angular apps, integrations, store releases and maintenance.ctxforge · Project storyctxforge: turn “add search” into a task an agent can build“Add search” leaves decisions about data, matching and behavior unanswered. I built an editable toolkit that asks an LLM to uncover those requirements and show its assumptions before a coding agent starts.Sociedades Inactivas enquiries · Technical noteAn enquiry should survive a failed emailA failed notification should not make someone submit the same enquiry twice. The implemented form keeps the saved request and its reference while email delivery is retried; live activation is still pending.Astro local-services website · Project storyKeeping local service pages and their FAQs consistentA city page should only offer services enabled for that location. I used shared Astro templates with explicit availability rules, and one FAQ selection for both the visible page and its structured data.3D Spaces website migration · Project storyMoving 3D Spaces without moving its mailboxThe website could move to Next.js and Vercel, while email still depended on the old host. I carried over the pages, enquiry flow and analytics, then checked what the cutover had actually preserved.Capture CRM · Project storySave the listing now, connect the person when the details arriveA classified listing may arrive before its phone number or contact name. Capture CRM keeps those records separate, then lets a later capture complete the existing listing and bring contact status back to the browsing page.Product-description comparison bench · ExperimentWhere did the product description get that detail wrong?A product description can go wrong when the image is read or when the copy is written. This local bench exposes both steps, lets me switch models and records request measurements. A matched quality comparison is still unfinished.Between Us · Project storyBetween Us: keeping control of a generated filmA more emotional dialogue take still needed convincing acting and framing. I kept the alternatives, widened shots to reveal gestures and changed the workflow when its studio limited the films I wanted to make.Restaurant-service voice agent · ExperimentDesigning a restaurant-service call around the real offerThe first correction was the offer: a paid service had become a free visit in one draft. I then compared how the Spanish voice-agent prompts handled new speakers, technical limits and booking results.Vapi and Telnyx voice integration · Technical noteThe Vapi agent could speak, but it could not hear me clearlyI could hear the assistant, but it could not understand my distorted audio. Three codec tests changed the connection behavior and brought the greeting back; the caller-audio problem remains unresolved.Warloop: Echoes of Solmara · Project storyWarloop: turning generated character art into a playable prototypeGood-looking character images became tiny figures, a backwards walk and misplaced bosses in the game. I worked through the gap between generated art and playable behavior.
esc to close · Tab to move through results