Introducing a new way to review your PRs.

Read the announcement

calicastle / cali.so

Personal website for Cali Castle

View on GitHub

21 documents · Updated Sep 21, 2026

docs / public-site-experience

Public site experience

The public site is a bilingual portfolio and publishing experience for presenting work, writing, photos, and an AMA service. Chinese routes use the site root and English routes use the /en prefix. Both route families share the same page structure, visual language, and visitor controls. A separate résumé experience uses paired private routes and does not use the public frame.

Route composition

Locale route families

The public site has two explicit route families. The Chinese family serves paths such as /, /blog, /photos, and /ama. The English family serves the same page shapes below /en, such as /en, /en/blog, /en/photos, and /en/ama. A shared view receives the selected locale so the route decides the language without changing the page’s purpose.

flowchart LR
    Request[Public request] --> Locale{Locale path}
    Locale -->|Chinese| Zh[Root route family]
    Locale -->|English| En[/en route family]
    Zh --> View[Shared page view]
    En --> View
    View --> Content[Localized page experience]

The route layer also assigns page metadata and rejects invalid content identifiers. This keeps the URL, page language, and search-facing description aligned before the shared view renders. Localization, navigation, and discovery explains the wider locale and public-route rules.

References: app/…/layout.tsx• L1-9 app/…/layout.tsx• L1-9 app/…/page.tsx• L1-15 app/…/page.tsx• L1-15 lib/locale-route.ts• L1-86

Public route groups

The public routes group around a small set of visitor goals. The home page gives the broad profile, index pages organize work and writing, detail pages carry long-form or archived material, and the AMA routes move from service information into booking.

Route groupVisitor goal
HomeUnderstand the person and reach the main areas
ProjectsReview selected work and follow project links
PhotosBrowse the published photo set
BlogBrowse writing by year and open an article
Newsletter archivesRead retired newsletters as read-only records
AMALearn about the session and start a booking
Legacy confirmationReach a safe retirement page for old newsletter links

Each route group has a Chinese and English entry point. The detail routes keep the same content identity across locales, so a visitor can change language without losing the selected post or archive item. Published content delivery describes how published material reaches these views.

References: app/…/page.tsx• L1-22 app/…/page.tsx• L1-15 app/…/page.tsx• L1-18 app/…/page.tsx• L1-19 app/…/page.tsx• L1-34 app/…/page.tsx• L1-7 app/…/page.tsx• L1-17

Private résumé routes

The résumé is a separate invitation-only experience with English and Chinese route families. Each locale route passes through the same résumé view, but its own document shell supplies a focused navigation link back to the public site and a link to the other language. The résumé route waits for access before it renders private content, and its metadata marks the page as non-public.

The résumé shell is intentionally outside the public document frame. It does not add the public dock, footer, analytics, social reads, or public route transitions. This boundary keeps a private résumé visit separate from the public portfolio experience. The private résumé experience page covers its access and content flow.

References: app/…/layout.tsx• L1-9 app/…/page.tsx• L1-9 app/…/layout.tsx• L1-9 app/…/page.tsx• L1-7 app/…/resume-document.tsx• L8-35 app/…/resume-page.tsx• L21-37

Shared public frame

Document shell

The document shell gives every public page the same frame. It sets the page language and font set, adds the ambient paper surface, places the main content in a narrow reading column, and keeps the footer and bottom dock available across routes.

The shell also gathers live social and GitHub summaries for the shared footer. The page body remains the route-specific part of the experience, while the shell supplies the stable context around it. Private and admin documents use a reduced shell instead, so they keep the page geometry without public analytics, social reads, or route transitions.

References: app/…/site-document.tsx• L24-44 app/…/site-document.tsx• L48-72 app/…/site-document.tsx• L75-117 app/site-document.test.tsx• L73-137 app/globals.css• L98-180 app/fonts.ts• L43-53

The bottom dock is the main persistent navigation surface. It gives the visitor direct access to Home, Writing, Photos, Projects, and AMA, then adds Preferences for language, theme, and sound choices. The active item follows the unlocalized route, so the indicator stays correct in both route families.

The home avatar acts as the return path. The same destinations also appear as visual cards on the home page and as an index tree in the footer, which gives visitors more than one way to move through the site.

References: components/dock.tsx• L27-32 components/dock.tsx• L173-245 components/site-footer.tsx• L47-110 components/nav-cards.tsx• L10-46

The footer closes the public reading column with contact links, a site index, the current year, and a small location and time display. It is part of the public frame rather than a page-specific content block, so it gives every route the same way to reach external contact points and the main index.

References: components/site-footer.tsx• L47-138

Public views

Home view

The home view is the site’s orientation page. It combines a short introduction with entry cards for writing, photos, and projects, then adds experience, recent writing, and optional personal shelves for records and books. Its photo card uses the current published photo selection, so the home page can introduce the photo area without duplicating the full gallery.

The view keeps the page compact and ordered. Visitors first learn who the site represents, then choose a content area, and only after that see the longer profile sections.

References: app/…/home-page.tsx• L45-102 app/…/home-page.tsx• L104-195 components/nav-cards.tsx• L21-158

Index views

Projects, Photos, and Writing each have a focused index view. Projects present a short list of work with a clear distinction between local pages and external destinations. Photos present a quiet image wall. Writing groups posts by year so the archive reads as a time-based record.

These views share the same narrow column and staged entrance pattern, but each uses a visual treatment that matches its subject: blueprint-like focus for projects, a photo wall for images, and an ink-like focus lane for writing.

References: app/…/projects-page.tsx• L13-90 app/…/photos-page.tsx• L11-30 app/…/blog-index-page.tsx• L11-73

Detail views

Detail views support two reading modes. Blog posts use a cover, title information, article body, table of contents, and related posts. Newsletter pages preserve older material as read-only archives. The retired confirmation route does not restore subscription behavior; it directs readers to the site or the appropriate RSS feed.

The AMA page is a service view rather than an article. It explains the session, topics, booking steps, and policy, then sends the visitor to the separate booking flow. The booking page keeps the transaction apart from the editorial explanation.

References: app/…/blog-post-page.tsx• L161-275 app/…/newsletter-archive-page.tsx• L39-95 app/…/newsletter-retired-page.tsx• L22-89 app/…/ama-page.tsx• L14-22 app/…/ama-page.tsx• L214-467 app/…/ama-book-page.tsx• L9-49

Visual interaction system

Motion layers

The site uses motion to show relation and focus rather than to add movement to every element. Page entrances reveal the main blocks in order. Long lists reveal below-fold items as they enter view. Project and writing lists add a local focus field around the row under the pointer or keyboard focus.

The visual effects have safe fallbacks. Reduced-motion settings remove the animated path, and devices without the needed graphics support keep the static focus treatment. This lets the content remain usable when motion is not suitable or available.

References: components/reveal-scope.tsx• L10-15 components/reveal-scope.tsx• L29-97 components/hidden-list-stage.tsx• L29-48 components/hidden-list-stage.tsx• L178-239 components/hidden-list-stage.tsx• L301-467

Route transitions

Route changes normally keep the public frame stable while the content area changes. A direct pointer open from a writing list can carry the article cover and title into the detail view. Keyboard navigation, browser history, and other route changes use the quiet path instead of forcing that visual link.

sequenceDiagram
    participant Visitor
    participant List as Writing list
    participant Router as Public route
    participant Article as Article view
    Visitor->>List: Open an article
    List->>Router: Navigate to localized post route
    Router->>Article: Render the matching post
    Article-->>Visitor: Continue with cover and title in place

The transition system is limited to the public content frame. It also shows a loading shell while an article is being prepared, so the route can change without leaving an empty page.

References: components/route-motion-controller.tsx• L6-63 components/post-transition-link.tsx• L6-57 app/…/blog-post-page.tsx• L54-108 app/…/site-document.tsx• L91-110

Image focus

Photo and article images can open into a focused view above the page. The focused view uses a larger image when one is available, exposes photo details where the page provides them, and returns focus to the image that opened it.

The interaction closes on Escape, an overlay click, a scroll gesture, or a viewport change. It becomes immediate when the visitor requests reduced motion, so the image remains accessible without depending on an animation.

References: components/zoom-image.tsx• L65-78 components/zoom-image.tsx• L159-253 components/zoom-image.tsx• L259-337 components/published-photo-wall.tsx• L86-145

Visitor preferences

Preferences let visitors choose language, light or dark appearance, and interface sound. Public language changes move to the matching explicit route. Theme and sound choices persist when browser storage allows it, while the page still works when storage is not available.

The public site selects the language from the URL before the page is shown. A small suggestion can offer the visitor’s preferred language, but it does not silently replace an explicit public route.

References: components/preferences.tsx• L35-121 components/theme-provider.tsx• L12-104 components/locale-suggestion.tsx• L41-99 app/…/site-document.tsx• L78-99

Localized experience boundaries

The public site keeps Chinese and English content in one page shape while allowing each route to carry its own title, description, labels, dates, and article text. Shared controls render both language forms in the page frame, and the active route selects which form the visitor sees.

The route is the source of truth for public language. This is different from the protected admin surface, where a saved preference can restore the display language in place. For public routes, language changes preserve the current content path and move to its counterpart instead. See Localization, navigation, and discovery for route pairs, metadata, feeds, and search-facing behavior.

References: lib/i18n.tsx• L3-24 lib/locale-route.ts• L58-86 components/locale-suggestion.tsx• L62-140 components/preferences.tsx• L90-121

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep the Chinese and English public route families mapped to the same view and content identity.
  • Keep the private résumé route pair mapped to the same protected view while keeping its shell outside public chrome.
  • Keep dock, home cards, footer index links, and locale path generation aligned when a public destination changes.
  • Keep route metadata and language alternates aligned with the visible page language.
  • Keep public and private document boundaries aligned with analytics, social reads, route transitions, and access checks.
  • Keep transition names and loading-shell markers aligned when the article list or article header changes.
  • Keep reduced-motion, keyboard-focus, touch, and graphics-fallback paths aligned when a visual interaction changes.

Important failure modes

TriggerConsequenceGuard
A public page has no matching English or Chinese route entryVisitors can lose the same content when they switch languageKeep paired route entries and pass the same content identity to both views
A résumé locale route renders through the public shellA private visit can expose public analytics or chrome and weaken the access boundaryKeep résumé layouts on ResumeDocument and protect content before rendering
A dock or footer link skips localePathA visitor opens the wrong language familyGenerate public internal links from the active locale
A list transition loses its row or loading-shell markerArticle navigation falls back to a hard route change or can leave an empty transition stateKeep list and article transition contracts together
A visual stage ignores reduced-motion or graphics supportSome visitors get motion they did not request or no usable focus stateRetain static states and input-mode fallbacks
A zoomed image does not close on viewport changeThe focused image can no longer match its page positionClose and return focus when the viewport or scroll position changes

Key files

FileWhy to read it
app/…/site-document.tsxDefines the shared public document frame and separates public, private, and admin chrome
app/site-document.test.tsxShows the public shell guarantees and its exclusion rules for private and admin documents
lib/locale-route.tsDefines the relationship between root and /en public paths
components/dock.tsxShows persistent navigation and active-route behavior
components/preferences.tsxShows visitor language, theme, sound, and owner-entry controls
app/…/home-page.tsxShows how the site introduces its person and main content areas
app/…/projects-page.tsxShows the project index experience
app/…/photos-page.tsxShows the published photo entry experience
app/…/blog-index-page.tsxShows the writing archive experience
app/…/blog-post-page.tsxShows the long-form article experience and route loading path
components/route-motion-controller.tsxShows the public route motion boundary
components/zoom-image.tsxShows the shared focused-image interaction
components/hidden-list-stage.tsxShows the shared list focus behavior for projects and writing
app/…/resume-document.tsxDefines the separate private résumé frame and locale links
app/…/resume-page.tsxShows the access boundary before résumé content appears