PhoenixKitKnowledgeBase.Paths (PhoenixKitKnowledgeBase v0.1.0)

Copy Markdown View Source

Centralized path helpers. Every link and redirect in this module goes through PhoenixKit.Utils.Routes.path/1, which applies the host's URL prefix and the current locale — PhoenixKit paths are never hardcoded, and relative hrefs break as soon as the current URL has one more segment than you assumed.

Summary

Functions

A vault's membership page.

The "create this note" page for a title that doesn't exist yet — where an unresolved [[wiki-link]] points.

A single note inside a vault.

A vault's workspace.

The vault list.

Functions

members(slug)

@spec members(String.t()) :: String.t()

A vault's membership page.

new_note(slug, title \\ nil)

@spec new_note(String.t(), String.t() | nil) :: String.t()

The "create this note" page for a title that doesn't exist yet — where an unresolved [[wiki-link]] points.

A page with a Create button rather than a URL that creates on GET: a link that writes to the database when a browser prefetches it, or when someone refreshes, is a trap.

note(slug, note_uuid)

@spec note(String.t(), String.t()) :: String.t()

A single note inside a vault.

vault(slug)

@spec vault(String.t()) :: String.t()

A vault's workspace.

vaults()

@spec vaults() :: String.t()

The vault list.