SEO & Indexing
How the Targ Apps marketing site exposes robots.txt, sitemap.xml, blog RSS, meta tags, and JSON-LD.
Search-engine indexing for targapps.xyz is implemented in the targ-apps project. SEO constants and XML builders live in shared modules so routes stay in sync.
Configuration module
app/lib/seo.ts defines:
- Site origin and canonical URL (
https://www.targapps.xyz/) - Default title, description, and Open Graph image
- Blog URLs (
/blog,/blog/rss.xml) buildSitemapEntries()— homepage, blog index, and published blog postsbuildSitemapXml()andbuildRobotsTxt()- JSON-LD objects for Organization, WebSite, and ProfessionalService
Update this file when adding indexable pages or changing site-wide SEO constants.
Resource routes
React Router resource routes (loader-only, no UI component) serve crawler-facing endpoints:
| Route file | URL | Content-Type |
|---|---|---|
app/routes/sitemap[.]xml.ts | /sitemap.xml | application/xml |
app/routes/robots[.]txt.ts | /robots.txt | text/plain |
app/routes/blog.rss[.]xml.tsx | /blog/rss.xml | application/rss+xml |
The sitemap loader reads published blog posts and passes them to buildSitemapEntries(). The blog RSS loader reads the same posts through getAllPosts() and buildBlogRssFeed().
Routes are registered in app/routes.ts and prerendered at build time alongside the homepage and blog pages.
Meta tags & structured data
The homepage route (app/routes/home.tsx) exports:
- Standard meta — title, description, keywords, author, robots directives
- Open Graph — type, site name, locale, title, description, url, image dimensions
- Twitter Card —
summary_large_imagewith title, description, image - Canonical URL —
https://www.targapps.xyz/ - JSON-LD — Organization, WebSite, and ProfessionalService schemas via
script:ld+json
Global layout (app/root.tsx) declares the blog RSS alternate link so feed autodiscovery works site-wide.
Blog routes export their own meta() entries with article Open Graph tags and RSS alternates.
Prerendering
react-router.config.ts prerenders:
//sitemap.xml/robots.txt/blog/blog/rss.xml/blog/[slug]for every published post
Without prerendering, SPA mode would ship an empty HTML shell and most crawlers would miss route-level meta tags.
robots.txt rules
User-agent: *
Allow: /
Disallow: /targapps_kvdb.html
Sitemap: https://www.targapps.xyz/sitemap.xmlThe internal KV demo at /targapps_kvdb.html remains reachable but is excluded from indexing.
Adding a new public page
- Create the route under
app/routes/. - Export
meta()andlinks()with a canonical URL. - For blog posts, add an MDX file under
content/blog/— sitemap and RSS update automatically. - For other indexable pages, extend
buildSitemapEntries()inapp/lib/seo.ts. - Rebuild — prerender regenerates crawler endpoints with updated content.
Verification
After npm run build, confirm generated files exist under build/client/:
index.html— contains prerendered meta and JSON-LDblog/index.htmlandblog/*/index.html— blog pagessitemap.xml,robots.txt,blog/rss.xml— crawler endpoints
Run:
npm test
npm run typecheck
npm run build