Skip to content

feat: the public directory site - #135

Merged
OriginDevIT merged 2 commits into
mainfrom
feat/block2-public-site
Sep 6, 2026
Merged

feat: the public directory site#135
OriginDevIT merged 2 commits into
mainfrom
feat/block2-public-site

Conversation

@OriginDevIT

Copy link
Copy Markdown
Owner

Catch-all dispatcher resolving home, category browse and listing detail, with the path_segment present only when the tenant runs more than one listing type. PathRedirect served as a single 301 ahead of segment resolution. Every public listing read goes through Listing.objects.published(), enforced by a source-scanning guard test; a draft, hidden or unknown slug is a 404. Canonical is the category with lowest (order, slug). Category page 1 indexable, page 2+ and thin categories noindex, search always noindex.

OriginDevIT and others added 2 commits September 6, 2026 15:28
Block 2, PR 3b of 2. Unauthenticated, read-only, GET only. No HTMX;
plain GET forms.

- public_dispatch: one catch-all on osds/urls_tenant that resolves
  home, type landing, category browse and listing detail against the
  tenant's live listing-type count -- the path_segment prefix appears
  only when there is more than one type (spec §4.5). Home is a type
  picker when multi-type.

- PathRedirect served as a single 301 before segment resolution,
  browse tree only: longest old_prefix wins, "" prepends new_prefix,
  robots.txt / sitemap.xml skipped (they are PR 4). One redirect per
  request, no chains (ruling 2).

- Only Listing.objects.published() anywhere public. A draft, hidden or
  unknown slug is a 404 (handler404 -> public/404.html); a listing
  reached via a category it is not in is a 404. A source-scan test
  guards the rule.

- Canonical: directory.routing.canonical_category picks the category
  with the lowest (order, slug); listing detail always emits
  <link rel=canonical> to that category's path (ruling 3).

- Category browse: page 1 indexable, page 2+ and categories with fewer
  than 3 published listings carry <meta name=robots content=noindex>.
  Search result pages are always noindex.

- Templates under directory/templates/public/ with a base distinct
  from the admin base; a public_urls templatetag library builds the
  segment-aware URLs. Listing cards link through the canonical
  category; a listing with no category shows without a link.

robots.txt and the sitemap are PR 4.

26 new tests. check and makemigrations --check clean; the public-site,
admin-view and host-resolution suites pass on a real postgres:16.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5qqrLcxpVZRis5jbN5pKD
Signed-off-by: Matthew Wren <info@origindev.com>
test_page_two_is_noindex reassigned public_views.PER_PAGE and only
restored it in a finally -- fragile, and test order decided what
later tests saw.

PER_PAGE is now OSDS_PUBLIC_PAGE_SIZE (default 20), read at request
time via getattr(settings, ...), and used by both the category-browse
Paginator and the search per_page. The test uses
@override_settings(OSDS_PUBLIC_PAGE_SIZE=2).

check, makemigrations --check and the public-site + search suites (35)
pass on a real postgres:16.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5qqrLcxpVZRis5jbN5pKD
Signed-off-by: Matthew Wren <info@origindev.com>
@OriginDevIT
OriginDevIT merged commit 2fa6ad2 into main Sep 6, 2026
1 check passed
@OriginDevIT
OriginDevIT deleted the feat/block2-public-site branch September 6, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant