Search documentation of phoenix_kit

# PhoenixKitWeb.BlogHTML (phoenix_kit v1.6.19)

View Source

HTML rendering functions for BlogController.

# Summary

## Functions

all_blogs(assigns)
blog_listing_path(language, blog_slug, params \\ [])

Builds the public URL for a blog listing page. When multiple languages are enabled, always includes locale prefix. When languages module is off or only one language, uses clean URLs.

build_post_url(blog_slug, post, language)

Builds a post URL based on mode. When multiple languages are enabled, always includes locale prefix. When languages module is off or only one language, uses clean URLs.

build_public_path_with_time(language, blog_slug, date, time)

Builds a public path with explicit date and time (always includes time). Used when redirecting from date-only URLs to full timestamp URLs.

build_public_translations(translations, current_language)

Builds language data for the blog_language_switcher component on public pages. Converts the @translations assign to the format expected by the component.

extract_excerpt(content)

Extracts and renders an excerpt from post content. Returns content before <!-- more --> tag, or first paragraph if no tag. Renders markdown and strips HTML tags for plain text display.

featured_image_url(post, variant \\ "medium")

Resolves a featured image URL for a post, falling back to the original variant.

format_date(datetime)

Formats a date for display.

format_date_for_url(datetime)

Formats a date for URL.

format_date_with_time(datetime)

Formats a date with time for display. Used when multiple posts exist on the same date.

format_post_date(post, blog_slug)

Formats a post's publication date, including time only when multiple posts exist on the same date.

format_time_for_url(datetime)

Formats time for URL (HH:MM).

index(assigns)
pluralize(count, singular, plural)

Pluralizes a word based on count.

show(assigns)

# Functions

# all_blogs(assigns)

# blog_listing_path(language, blog_slug, params \\ [])

Builds the public URL for a blog listing page. When multiple languages are enabled, always includes locale prefix. When languages module is off or only one language, uses clean URLs.

# build_post_url(blog_slug, post, language)

Builds a post URL based on mode. When multiple languages are enabled, always includes locale prefix. When languages module is off or only one language, uses clean URLs.

For timestamp mode posts:

- If only one post exists on the date, uses date-only URL (e.g., /blog/2025-12-09)
- If multiple posts exist on the date, includes time (e.g., /blog/2025-12-09/16:26)

# build_public_path_with_time(language, blog_slug, date, time)

Builds a public path with explicit date and time (always includes time). Used when redirecting from date-only URLs to full timestamp URLs.

# build_public_translations(translations, current_language)

Builds language data for the blog_language_switcher component on public pages. Converts the @translations assign to the format expected by the component.

# extract_excerpt(content)

Extracts and renders an excerpt from post content. Returns content before <!-- more --> tag, or first paragraph if no tag. Renders markdown and strips HTML tags for plain text display.

# featured_image_url(post, variant \\ "medium")

Resolves a featured image URL for a post, falling back to the original variant.

# format_date(datetime)

Formats a date for display.

# format_date_for_url(datetime)

Formats a date for URL.

# format_date_with_time(datetime)

Formats a date with time for display. Used when multiple posts exist on the same date.

# format_post_date(post, blog_slug)

Formats a post's publication date, including time only when multiple posts exist on the same date.

# format_time_for_url(datetime)

Formats time for URL (HH:MM).

# index(assigns)

# pluralize(count, singular, plural)

Pluralizes a word based on count.

# show(assigns)