Files
berrypod/lib/berrypod_web/components/seo_checklist.ex
jamey 4aa7dece0c
All checks were successful
deploy / deploy (push) Successful in 4m59s
add SEO enhancements: OG images, meta robots, FAQ block, image sitemap
- Per-page SEO controls: meta robots directives, focus keyword, OG image
- Site-wide default OG image in admin settings
- FAQ block type with FAQPage JSON-LD schema
- Enhanced Organization JSON-LD with business info, contact, address
- Image sitemap with product images
- SEO preview panel with Google/social card mockups
- SEO checklist with real-time scoring
- Business info section in site editor
- GSC integration scaffolding (OAuth, client, cache)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-17 16:47:43 +01:00

51 lines
1.4 KiB
Elixir

defmodule BerrypodWeb.Components.SeoChecklist do
@moduledoc """
SEO checklist component showing focus keyword analysis results.
Displays a score and list of checks with pass/fail/warning status.
"""
use Phoenix.Component
import BerrypodWeb.CoreComponents, only: [icon: 1]
alias Berrypod.SEO.Analyser
@doc """
Renders the SEO checklist with score and checks.
"""
attr :page, :map, required: true
def seo_checklist(assigns) do
checks = Analyser.analyse(assigns.page)
score = Analyser.score(checks)
level = Analyser.score_level(score)
assigns =
assigns
|> assign(:checks, checks)
|> assign(:score, score)
|> assign(:level, level)
~H"""
<div class="seo-checklist">
<div class="seo-score" data-level={@level}>
<span class="seo-score-value">{@score}%</span>
<span class="seo-score-label">SEO score</span>
</div>
<ul class="seo-checks">
<li :for={check <- @checks} class="seo-check" data-status={check.status}>
<.icon name={status_icon(check.status)} class="size-4 seo-check-icon" />
<span class="seo-check-label">{check.label}</span>
<span class="seo-check-hint">{check.message}</span>
</li>
</ul>
</div>
"""
end
defp status_icon(:pass), do: "hero-check-circle"
defp status_icon(:fail), do: "hero-x-circle"
defp status_icon(:warning), do: "hero-exclamation-triangle"
end