All Projects → ngs → middleman-ogp

ngs / middleman-ogp

Licence: MIT License
middleman-og is an extension for the Middleman static site generator that adds Open Graph helper.

Programming Languages

ruby
36898 projects - #4 most used programming language
Gherkin
971 projects
HTML
75241 projects

Projects that are alternatives of or similar to middleman-ogp

middleman-robots
middleman-robots is extension of Middleman. This extension create robots.txt by config.rb.
Stars: ✭ 33 (-10.81%)
Mutual labels:  middleman, middleman-extension
joinplu.me
The official Plume website
Stars: ✭ 13 (-64.86%)
Mutual labels:  middleman
Middleman Template
The base Middleman application used at thoughtbot, ready to deploy to Netlify.
Stars: ✭ 80 (+116.22%)
Mutual labels:  middleman
middleman-directory
Directory of Middleman extensions, templates and services
Stars: ✭ 30 (-18.92%)
Mutual labels:  middleman
Middleman Zurb Foundation
Middleman Skeleton For Zurb Foundation
Stars: ✭ 97 (+162.16%)
Mutual labels:  middleman
neocortex
🧠Neocortex is a tool to connect your cognitive service (e.g. DialogFlow) 🤖 with your communication channels (like facebook) 📞to create amazing bots
Stars: ✭ 24 (-35.14%)
Mutual labels:  middleman
Middleman Thumbnailer
Thumbnailer for middleman
Stars: ✭ 52 (+40.54%)
Mutual labels:  middleman
middleman starter kit
Middleman front-end starter kit
Stars: ✭ 19 (-48.65%)
Mutual labels:  middleman
website
Comunidade Brasileira Ember
Stars: ✭ 14 (-62.16%)
Mutual labels:  middleman
middleman-snippets
⚡ Library of commonly used snippets for Middleman websites
Stars: ✭ 27 (-27.03%)
Mutual labels:  middleman
Staticman
💪 User-generated content for Git-powered websites
Stars: ✭ 2,098 (+5570.27%)
Mutual labels:  middleman
Middleman Autoprefixer
Autoprefixer integration with Middleman
Stars: ✭ 114 (+208.11%)
Mutual labels:  middleman
nakama-docs
Documentation for Nakama social and realtime server.
Stars: ✭ 44 (+18.92%)
Mutual labels:  middleman
Middleman Google Analytics
📈 A @middleman plugin to handle generating your Google Analytics tracking code.
Stars: ✭ 91 (+145.95%)
Mutual labels:  middleman
middleman-startae
A starter template ready to run on Netlify or Heroku. Comes with several helpers, partials and a nice basic structure to the HTML, Sass, Webpack and ES2015. Bottom line, a template that uses all the modern tools.
Stars: ✭ 43 (+16.22%)
Mutual labels:  middleman
Middleman Search
LunrJS-based search for Middleman
Stars: ✭ 57 (+54.05%)
Mutual labels:  middleman
lang-compare
Side-by-side language comparison
Stars: ✭ 22 (-40.54%)
Mutual labels:  middleman
middleman-gulp
A Middleman 4 template using Gulp.js via the external pipeline
Stars: ✭ 42 (+13.51%)
Mutual labels:  middleman
Manager For Upyun
又拍云资源管理器
Stars: ✭ 163 (+340.54%)
Mutual labels:  middleman
middleman-fontcustom
Generate webfonts in your Middleman project
Stars: ✭ 13 (-64.86%)
Mutual labels:  middleman

Middleman-OGP

middleman-ogp is an extension for the Middleman static site generator that adds OpenGraph Protocol support.

Configuration

In your config.rb

activate :ogp do |ogp|
  #
  # register namespace with default options
  #
  ogp.namespaces = {
    fb: data.ogp.fb,
    # from data/ogp/fb.yml
    og: data.ogp.og
    # from data/ogp/og.yml
  }
  ogp.base_url = 'http://mysite.tld/'
end

In your project's root directory

Create data/ogp/fb.yml and data/ogp/og.yml files.

Example:

image:
  "": http://mydomain.tld/path/to/fbimage.png
  secure_url: https://secure.mydomain.tld/path/to/fbimage.png
  type: image/png
  width: 400
  height: 300
locale:
  "": en_us

In your layout

source/layout.slim

html
  head
    meta charset="utf-8"
    title= data.page.title
    - ogp_tags do|name, value|
      meta property=name content=value

  body
    .container
      = yield

In your page source

Page data overrides default options. (deep merge).

---
ogp:
  og:
    description: "This is my fixture Middleman site."
    image:
      "": http://mydomain.tld/path/to/fbimage.png
      secure_url: https://secure.mydomain.tld/path/to/fbimage.png
      type: image/png
      width: 400
      height: 300
    locale:
      "": en_us
      alternate:
        - ja_jp
        - zh_tw
  fb:
    description: "This is my fixture Middleman site."
    image:
      "": http://mydomain.tld/path/to/fbimage.png
      secure_url: https://secure.mydomain.tld/path/to/fbimage.png
      type: image/png
      width: 400
      height: 300
---

# Hello

This is the **content**

Blog Support

middleman-ogp supports adding article properties like article:published_time, article:tag automatically for middleman-blog articles.

Set ogp.blog to true in your configuration. (Defaults to false)

activate :ogp do |ogp|
  #
  # register namespace with default options
  #
  ogp.namespaces = {
    fb: data.ogp.fb,
    # from data/ogp/fb.yml
    og: data.ogp.og
    # from data/ogp/og.yml
  }
  ogp.blog = true
end

Build & Dependency Status

Gem Version Run tests

License

Copyright (c) 2014-2020 Atsushi Nagase. MIT Licensed, see LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].