feat: SEO audit fixes — meta description, robots.txt, sitemap, noindex
- Add <meta name="description"> block to base template - Add <meta name="robots" content="noindex, nofollow"> on preview, error, flow-step, and not-available pages (ephemeral content) - Add og:locale meta tag for pt_BR - Add robots block and canonical block to base layout - Create robots.txt (disallow /health, reference sitemap) - Add dynamic /sitemap.xml route from flow registry - Create SVG favicon and update link tag - All 60 tests passing https://claude.ai/code/session_01CvrcMDqfCKWV2hC3xpRbx3
This commit is contained in:
parent
2a05f926ab
commit
c9fa698884
|
|
@ -0,0 +1,4 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<rect width="32" height="32" rx="6" fill="#007A5F"/>
|
||||
<text x="16" y="23" font-family="system-ui,sans-serif" font-size="20" font-weight="bold" fill="white" text-anchor="middle">J</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 257 B |
|
|
@ -0,0 +1,5 @@
|
|||
User-agent: *
|
||||
Allow: /
|
||||
Disallow: /health
|
||||
|
||||
Sitemap: https://jus-ia.com/sitemap.xml
|
||||
|
|
@ -1,9 +1,32 @@
|
|||
import type { FastifyInstance } from "fastify";
|
||||
import { getAreas, getTiposTarefa } from "../config/flows.js";
|
||||
import { getAreas, getTiposTarefa, getAllFlows } from "../config/flows.js";
|
||||
import { trabalhistaArea } from "../flows/trabalhista/index.js";
|
||||
import { civelArea } from "../flows/civel/index.js";
|
||||
|
||||
const SITE_URL = process.env.SITE_URL || "https://jus-ia.com";
|
||||
|
||||
export async function homeRoutes(app: FastifyInstance): Promise<void> {
|
||||
// GET /sitemap.xml — Dynamic sitemap
|
||||
app.get("/sitemap.xml", async (_request, reply) => {
|
||||
const flows = getAllFlows();
|
||||
const today = new Date().toISOString().split("T")[0];
|
||||
|
||||
const urls = [
|
||||
` <url><loc>${SITE_URL}/</loc><changefreq>weekly</changefreq><priority>1.0</priority><lastmod>${today}</lastmod></url>`,
|
||||
...flows.map(
|
||||
(f) =>
|
||||
` <url><loc>${SITE_URL}/${f.area}/${f.subtipo}</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>`,
|
||||
),
|
||||
];
|
||||
|
||||
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
${urls.join("\n")}
|
||||
</urlset>`;
|
||||
|
||||
return reply.type("application/xml").send(xml);
|
||||
});
|
||||
|
||||
// GET / — Landing page
|
||||
app.get("/", async (_request, reply) => {
|
||||
return reply.view("pages/home.njk", {
|
||||
|
|
|
|||
|
|
@ -5,15 +5,24 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Jus IA Start Kit{% endblock %}</title>
|
||||
|
||||
{% block metaDescription %}
|
||||
<meta name="description" content="Responda perguntas sobre seu caso e receba um pedido jurídico otimizado pronto para gerar resultado na primeira tentativa no Jus IA.">
|
||||
{% endblock %}
|
||||
|
||||
{% block robots %}{% endblock %}
|
||||
|
||||
{% block canonical %}{% endblock %}
|
||||
|
||||
{% block ogTags %}
|
||||
<meta property="og:title" content="Jus IA Start Kit — Monte seu pedido jurídico">
|
||||
<meta property="og:description" content="Responda perguntas sobre seu caso e receba um pedido otimizado pronto para gerar resultado na primeira tentativa.">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:locale" content="pt_BR">
|
||||
<meta property="og:image" content="/images/og-default.png">
|
||||
{% endblock %}
|
||||
|
||||
<link rel="stylesheet" href="/css/app.css">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
|
||||
</head>
|
||||
<body class="min-h-dvh bg-[var(--color-background)] text-[var(--color-text-primary)] font-sans">
|
||||
<main class="mx-auto max-w-[640px] px-4 pb-8">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{% extends "layouts/base.njk" %}
|
||||
|
||||
{% block title %}Erro — Jus IA Start Kit{% endblock %}
|
||||
{% block robots %}<meta name="robots" content="noindex, nofollow">{% endblock %}
|
||||
{% block metaDescription %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mt-8 text-center">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{% extends "layouts/base.njk" %}
|
||||
|
||||
{% block title %}{{ stepTitle }} — Jus IA Start Kit{% endblock %}
|
||||
{% block robots %}<meta name="robots" content="noindex, nofollow">{% endblock %}
|
||||
{% block metaDescription %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set backUrl = backHref %}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{% extends "layouts/base.njk" %}
|
||||
|
||||
{% block title %}Fluxo não disponível — Jus IA Start Kit{% endblock %}
|
||||
{% block robots %}<meta name="robots" content="noindex, nofollow">{% endblock %}
|
||||
{% block metaDescription %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% set backUrl = "/" %}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{% extends "layouts/base.njk" %}
|
||||
|
||||
{% block title %}Seu pedido está pronto — Jus IA Start Kit{% endblock %}
|
||||
{% block robots %}<meta name="robots" content="noindex, nofollow">{% endblock %}
|
||||
{% block metaDescription %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mt-4 mb-6">
|
||||
|
|
|
|||
Loading…
Reference in New Issue