PhoenixKit.Pages (phoenix_kit v1.6.4)

View Source

Pages module for file-based content management.

Provides filesystem operations for creating, editing, and organizing files and folders in a web-based interface.

Summary

Functions

Disables the Pages module.

Enables the Pages module.

Checks if Pages module is enabled.

Ensures the configured not found page exists on disk.

Returns true when PhoenixKit should keep the 404 inside the Pages module.

Returns the relative file path (with .md) for the configured not found page.

Returns the stored slug (without extension) used for custom 404 pages.

Gets the root directory path for pages.

Enables or disables the custom 404 handler.

Updates the slug used for the custom 404 page.

Functions

disable_system()

Disables the Pages module.

enable_system()

Enables the Pages module.

enabled?()

Checks if Pages module is enabled.

Examples

iex> PhoenixKit.Pages.enabled?()
true

ensure_not_found_page_exists()

Ensures the configured not found page exists on disk.

Creates a published markdown file with sensible defaults if missing.

handle_not_found?()

Returns true when PhoenixKit should keep the 404 inside the Pages module.

not_found_file_path()

Returns the relative file path (with .md) for the configured not found page.

not_found_slug()

Returns the stored slug (without extension) used for custom 404 pages.

root_path()

Gets the root directory path for pages.

Creates the directory if it doesn't exist. Uses the parent application's directory, not PhoenixKit's dependency directory.

Examples

iex> PhoenixKit.Pages.root_path()
"/path/to/app/priv/static/pages"

update_handle_not_found(enabled?)

Enables or disables the custom 404 handler.

update_not_found_slug(slug)

Updates the slug used for the custom 404 page.