HTML rendering functions for Publishing.Web.Controller.
Summary
Functions
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.
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.
Builds a public path with explicit date and time (always includes time). Used when redirecting from date-only URLs to full timestamp URLs.
Builds language data for the publishing_language_switcher component on public pages. Converts the @translations assign to the format expected by the component.
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.
Resolves a featured image URL for a post, falling back to the original variant.
Formats a date for display.
Formats a date for URL.
Formats a date with time for display. Used when multiple posts exist on the same date.
Formats a post's publication date, including time only when multiple posts exist on the same date.
Formats time for URL (HH:MM).
Checks if a post has a publication date to display. For timestamp mode, the date comes from the directory structure. For slug mode, it comes from metadata.published_at.
Pluralizes a word based on count.
Functions
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.
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 slug mode posts, uses the language-specific URL slug (from post.url_slug or post.language_slugs[language]) for SEO-friendly localized 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)
Builds a public path with explicit date and time (always includes time). Used when redirecting from date-only URLs to full timestamp URLs.
Builds language data for the publishing_language_switcher component on public pages. Converts the @translations assign to the format expected by the component.
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.
Resolves a featured image URL for a post, falling back to the original variant.
Formats a date for display.
Formats a date for URL.
Formats a date with time for display. Used when multiple posts exist on the same date.
Formats a post's publication date, including time only when multiple posts exist on the same date.
Formats time for URL (HH:MM).
Checks if a post has a publication date to display. For timestamp mode, the date comes from the directory structure. For slug mode, it comes from metadata.published_at.
Pluralizes a word based on count.