PhoenixKit.Blogging.Renderer (phoenix_kit v1.6.4)
View SourceRenders blog post markdown to HTML with caching support.
Uses PhoenixKit.Cache for performance optimization of markdown rendering. Cache keys include content hashes for automatic invalidation.
Summary
Functions
Clears all blog post caches.
Invalidates cache for a specific post.
Renders markdown or .phk content directly without caching.
Renders a post's markdown content to HTML.
Functions
Clears all blog post caches.
Useful for testing or when doing bulk updates.
Invalidates cache for a specific post.
Called when a post is updated in the admin editor.
Examples
Renderer.invalidate_cache("docs", "getting-started", "en")
Renders markdown or .phk content directly without caching.
Automatically detects .phk XML format and routes to PageBuilder. Falls back to Earmark markdown rendering for non-XML content.
Examples
html = Renderer.render_markdown(content)
Renders a post's markdown content to HTML.
Caches the result for published posts using content-hash-based keys. Lazy-loads cache (only caches after first render).
Examples
{:ok, html} = Renderer.render_post(post)