Skip to content

Trek::Pages::SearchEngineOptimizable ​

SEO metadata from the page's title, description and image: a blank title or description gives "", a missing image nil. Override the default_* methods to fall back on other values.

Methods ​

MethodReturns
seo_values{ title:, description:, image:, slug: } with fallbacks applied
meta_tagsseo_values without the slug — ready for your <head>
default_title / default_description / default_imagethe fallback values

Usage ​

slim
/ app/views/layouts/application.html.slim
- @page.meta_tags.each do |name, content|
  meta name=name content=content

Released under the MIT License.