2026-02-18 21:23:15 +00:00
|
|
|
|
defmodule BerrypodWeb.Shop.Content do
|
|
|
|
|
|
use BerrypodWeb, :live_view
|
2026-02-08 10:47:54 +00:00
|
|
|
|
|
2026-02-18 21:23:15 +00:00
|
|
|
|
alias Berrypod.Theme.PreviewData
|
2026-02-08 10:47:54 +00:00
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
|
def mount(_params, _session, socket) do
|
|
|
|
|
|
{:ok, socket}
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
|
def handle_params(_params, _uri, socket) do
|
|
|
|
|
|
config = page_config(socket.assigns.live_action)
|
|
|
|
|
|
{:noreply, assign(socket, config)}
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
@impl true
|
|
|
|
|
|
def render(assigns) do
|
|
|
|
|
|
~H"""
|
2026-02-18 21:23:15 +00:00
|
|
|
|
<BerrypodWeb.PageTemplates.content {assigns} />
|
2026-02-08 10:47:54 +00:00
|
|
|
|
"""
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
defp page_config(:about) do
|
|
|
|
|
|
%{
|
|
|
|
|
|
page_title: "About",
|
2026-02-23 21:31:35 +00:00
|
|
|
|
page_description: "Your story goes here – this is sample content for the demo shop",
|
add canonical URLs, robots.txt, and sitemap.xml
Canonical: all shop pages now assign og_url (reusing the existing og:url
assign), which the layout renders as <link rel="canonical">. Collection
pages strip the sort param so ?sort=price_asc doesn't create a duplicate
canonical.
robots.txt: dynamic controller disallows /admin/, /api/, /users/,
/webhooks/, /checkout/. Removed robots.txt from static_paths so it
goes through the router instead of Plug.Static.
sitemap.xml: auto-generated from all visible products + categories +
static pages, served as application/xml. 8 tests.
Also updates PROGRESS.md: marks tasks 55, 58, 59, 61, 62 as done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:47:35 +00:00
|
|
|
|
og_url: BerrypodWeb.Endpoint.url() <> "/about",
|
2026-02-08 10:47:54 +00:00
|
|
|
|
active_page: "about",
|
|
|
|
|
|
hero_title: "About the studio",
|
|
|
|
|
|
hero_description: "Your story goes here – this is sample content for the demo shop",
|
|
|
|
|
|
hero_background: :sunken,
|
|
|
|
|
|
image_src: "/mockups/night-sky-blanket-3",
|
|
|
|
|
|
image_alt: "Night sky blanket draped over a chair",
|
|
|
|
|
|
content_blocks: PreviewData.about_content()
|
|
|
|
|
|
}
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
defp page_config(:delivery) do
|
|
|
|
|
|
%{
|
|
|
|
|
|
page_title: "Delivery & returns",
|
2026-02-23 21:31:35 +00:00
|
|
|
|
page_description: "Everything you need to know about shipping and returns.",
|
add canonical URLs, robots.txt, and sitemap.xml
Canonical: all shop pages now assign og_url (reusing the existing og:url
assign), which the layout renders as <link rel="canonical">. Collection
pages strip the sort param so ?sort=price_asc doesn't create a duplicate
canonical.
robots.txt: dynamic controller disallows /admin/, /api/, /users/,
/webhooks/, /checkout/. Removed robots.txt from static_paths so it
goes through the router instead of Plug.Static.
sitemap.xml: auto-generated from all visible products + categories +
static pages, served as application/xml. 8 tests.
Also updates PROGRESS.md: marks tasks 55, 58, 59, 61, 62 as done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:47:35 +00:00
|
|
|
|
og_url: BerrypodWeb.Endpoint.url() <> "/delivery",
|
2026-02-08 10:47:54 +00:00
|
|
|
|
active_page: "delivery",
|
|
|
|
|
|
hero_title: "Delivery & returns",
|
|
|
|
|
|
hero_description: "Everything you need to know about shipping and returns",
|
|
|
|
|
|
content_blocks: PreviewData.delivery_content()
|
|
|
|
|
|
}
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
defp page_config(:privacy) do
|
|
|
|
|
|
%{
|
|
|
|
|
|
page_title: "Privacy policy",
|
2026-02-23 21:31:35 +00:00
|
|
|
|
page_description: "How we handle your personal information.",
|
add canonical URLs, robots.txt, and sitemap.xml
Canonical: all shop pages now assign og_url (reusing the existing og:url
assign), which the layout renders as <link rel="canonical">. Collection
pages strip the sort param so ?sort=price_asc doesn't create a duplicate
canonical.
robots.txt: dynamic controller disallows /admin/, /api/, /users/,
/webhooks/, /checkout/. Removed robots.txt from static_paths so it
goes through the router instead of Plug.Static.
sitemap.xml: auto-generated from all visible products + categories +
static pages, served as application/xml. 8 tests.
Also updates PROGRESS.md: marks tasks 55, 58, 59, 61, 62 as done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:47:35 +00:00
|
|
|
|
og_url: BerrypodWeb.Endpoint.url() <> "/privacy",
|
2026-02-08 10:47:54 +00:00
|
|
|
|
active_page: "privacy",
|
|
|
|
|
|
hero_title: "Privacy policy",
|
|
|
|
|
|
hero_description: "How we handle your personal information",
|
|
|
|
|
|
content_blocks: PreviewData.privacy_content()
|
|
|
|
|
|
}
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
defp page_config(:terms) do
|
|
|
|
|
|
%{
|
|
|
|
|
|
page_title: "Terms of service",
|
2026-02-23 21:31:35 +00:00
|
|
|
|
page_description: "The terms and conditions governing purchases from our shop.",
|
add canonical URLs, robots.txt, and sitemap.xml
Canonical: all shop pages now assign og_url (reusing the existing og:url
assign), which the layout renders as <link rel="canonical">. Collection
pages strip the sort param so ?sort=price_asc doesn't create a duplicate
canonical.
robots.txt: dynamic controller disallows /admin/, /api/, /users/,
/webhooks/, /checkout/. Removed robots.txt from static_paths so it
goes through the router instead of Plug.Static.
sitemap.xml: auto-generated from all visible products + categories +
static pages, served as application/xml. 8 tests.
Also updates PROGRESS.md: marks tasks 55, 58, 59, 61, 62 as done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 21:47:35 +00:00
|
|
|
|
og_url: BerrypodWeb.Endpoint.url() <> "/terms",
|
2026-02-08 10:47:54 +00:00
|
|
|
|
active_page: "terms",
|
|
|
|
|
|
hero_title: "Terms of service",
|
|
|
|
|
|
hero_description: "The legal bits",
|
|
|
|
|
|
content_blocks: PreviewData.terms_content()
|
|
|
|
|
|
}
|
|
|
|
|
|
end
|
|
|
|
|
|
end
|