class

Hwaro::Models::OpenGraphConfig

Inherits Reference / Object

OpenGraph and Twitter Card configuration

Constructors

Instance methods

all_tags(title : String, description : String | Nil, url : String, image : String | Nil, base_url : String, og_type_override : String | Nil = nil) : String

Generate both OG and Twitter tags

Source
auto_image
Source
auto_image=(auto_image : AutoImageConfig)
Source
default_image
Source
default_image=(default_image : String | Nil)
Source
fb_app_id
Source
fb_app_id=(fb_app_id : String | Nil)
Source
og_tags(title : String, description : String | Nil, url : String, image : String | Nil, base_url : String, og_type_override : String | Nil = nil) : String

Generate OG meta tags.

og_type_override lets the renderer force og:type="website" for the homepage, section indexes, taxonomy listings, and the 404 page — the configured @og_type ("article" by default) only fits content pages. See render.cr's og_type_for helper (gh#522).

Source
og_type
Source
og_type=(og_type : String)
Source
resolve_image_url(image : String | Nil, base_url : String) : String | Nil

Resolve an image path to an absolute URL, falling back to default_image

Source
twitter_card
Source
twitter_card=(twitter_card : String)
Source
twitter_creator
Source
twitter_creator=(twitter_creator : String | Nil)
Source
twitter_site
Source
twitter_site=(twitter_site : String | Nil)
Source
twitter_tags(title : String, description : String | Nil, image : String | Nil, base_url : String) : String

Generate Twitter Card meta tags

Source