Skip to content
Open Graph for ApostropheCMS
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/modules
views
.editorconfig
.eslintrc
.gitignore
LICENSE.md
README.md
index.js
package.json

README.md

apostrophe-open-graph

Facebook's Open Graph for ApostropheCMS.

Installation

npm install apostrophe-open-graph --save

Use

Configure apostrophe-open-graph in app.js.

const apos = require('apostrophe')({
  shortName: 'project',
  modules: {
    'apostrophe-open-graph': {}
  }
});

If you choose to disable fields for a piece or page you can do so by setting openGraph: false on the module. apostrophe-files, apostrophe-global, apostrophe-groups, apostrophe-images, apostrophe-users have openGraph: false configured by default.

module.exports = {
  name: 'person',
  label: 'Person',
  pluralLabel: 'People',
  openGraph: false
};

Add the following include to your <head></head> in layout.html that all of your pages extend, or to outerLayout.html if you have one in apostrophe-templates/views/. This will output the meta tags needed for Facebook Open Graph.

{% block extraHead %}
  {% include "apostrophe-open-graph:view.html" %}
{% endblock %}
You can’t perform that action at this time.