OgEx (og_ex v0.1.0)

Copy Markdown View Source

Embedded Open Graph and Twitter card rendering for Phoenix.

Use OgEx.Controller in a controller and pass a card module to the normal render call:

render(conn, :show, post: post, og: MyAppWeb.PostOgCard)

Normal requests render the Phoenix page and receive social metadata. A signed request to the generated image URL reruns the same action and returns the rendered card image instead.

Summary

Functions

Fetches query parameters for applications that still install plug OgEx.

Initializes the optional compatibility endpoint plug.

Functions

call(conn, options)

Fetches query parameters for applications that still install plug OgEx.

The controller integration performs the same operation lazily, so this compatibility callback is not required in new endpoint configurations.

init(options)

Initializes the optional compatibility endpoint plug.

New applications do not need this plug because controller rendering fetches the reserved query parameter lazily.