integrate R module and add url editor ui
Replaces hardcoded paths with R module throughout: - Shop components: layout nav, cart, product links - Controllers: cart, checkout, contact, seo, order lookup - Shop pages: collection, product, search, checkout success, etc. - Site context: nav item url resolution Admin URL management: - Settings page: prefix editor with validation feedback - Page renderer: url_editor component for page URLs - CSS for url editor styling Test updates for cache isolation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ defmodule BerrypodWeb.SeoController do
|
||||
use BerrypodWeb, :controller
|
||||
|
||||
alias Berrypod.{Pages, Products}
|
||||
alias BerrypodWeb.R
|
||||
|
||||
def robots(conn, _params) do
|
||||
base = BerrypodWeb.Endpoint.url()
|
||||
@@ -29,23 +30,23 @@ defmodule BerrypodWeb.SeoController do
|
||||
categories = Products.list_categories()
|
||||
|
||||
static_pages = [
|
||||
{"/", "daily", "1.0"},
|
||||
{"/collections/all", "daily", "0.9"},
|
||||
{"/about", "monthly", "0.5"},
|
||||
{"/contact", "monthly", "0.5"},
|
||||
{"/delivery", "monthly", "0.5"},
|
||||
{"/privacy", "monthly", "0.3"},
|
||||
{"/terms", "monthly", "0.3"}
|
||||
{R.home(), "daily", "1.0"},
|
||||
{R.collection("all"), "daily", "0.9"},
|
||||
{R.about(), "monthly", "0.5"},
|
||||
{R.contact(), "monthly", "0.5"},
|
||||
{R.delivery(), "monthly", "0.5"},
|
||||
{R.privacy(), "monthly", "0.3"},
|
||||
{R.terms(), "monthly", "0.3"}
|
||||
]
|
||||
|
||||
category_pages =
|
||||
Enum.map(categories, fn cat ->
|
||||
{"/collections/#{cat.slug}", "daily", "0.8"}
|
||||
{R.collection(cat.slug), "daily", "0.8"}
|
||||
end)
|
||||
|
||||
product_pages =
|
||||
Enum.map(products, fn product ->
|
||||
{"/products/#{product.slug}", "weekly", "0.9"}
|
||||
{R.product(product.slug), "weekly", "0.9"}
|
||||
end)
|
||||
|
||||
custom_pages =
|
||||
|
||||
Reference in New Issue
Block a user