{"_id":"@apostrophecms/open-graph-stable","name":"@apostrophecms/open-graph-stable","dist-tags":{"latest":"1.2.3"},"versions":{"1.2.3":{"name":"@apostrophecms/open-graph-stable","version":"1.2.3","description":"Open Graph fields for ApostropheCMS","main":"index.js","scripts":{"test":"npm run lint","lint":"eslint ."},"repository":{"type":"git","url":"git+https://github.com/apostrophecms/apostrophe.git","directory":"packages/open-graph"},"homepage":"https://github.com/apostrophecms/apostrophe/tree/main/packages/open-graph#readme","author":{"name":"Apostrophe Technologies"},"license":"MIT","devDependencies":{"eslint":"^9.39.1","eslint-config-apostrophe":"workspace:^"},"gitHead":"b3e29f004f514041e1e389293ae67017c60d006e","_id":"@apostrophecms/open-graph-stable@1.2.3","bugs":{"url":"https://github.com/apostrophecms/apostrophe/issues"},"_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-DryZ/7aUI5X25LSpKhqwx4tURbV+pGMTDOqIxUftDQ2jtaoLTOqUkSix/Cjg5mSeh611cS0q95nOUp24fMoIAA==","shasum":"cd3bd48314100e283d83e9fe0bd0c8d960b0767e","tarball":"https://registry.npmjs.org/@apostrophecms/open-graph-stable/-/open-graph-stable-1.2.3.tgz","fileCount":22,"unpackedSize":14301,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnhcct/SibzFqfOqU8wQw1NVFFx5o+Gadv5eH6FJZXUgIhANCn3LYDECU4zeQzl+lip6LIAZoRvmPWeAW7nmc7ue+T"}]},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"directories":{},"maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/open-graph-stable_1.2.3_1781112808163_0.20734555418301226"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T17:33:27.997Z","1.2.3":"2026-06-10T17:33:28.303Z","modified":"2026-06-10T17:33:28.637Z"},"maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"description":"Open Graph fields for ApostropheCMS","homepage":"https://github.com/apostrophecms/apostrophe/tree/main/packages/open-graph#readme","repository":{"type":"git","url":"git+https://github.com/apostrophecms/apostrophe.git","directory":"packages/open-graph"},"author":{"name":"Apostrophe Technologies"},"bugs":{"url":"https://github.com/apostrophecms/apostrophe/issues"},"license":"MIT","readme":"<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/apostrophecms/apostrophe/main/logo.svg\" alt=\"ApostropheCMS logo\" width=\"80\" height=\"80\">\n\n  <h1>Open Graph for ApostropheCMS</h1>\n  <p>\n    <a aria-label=\"Apostrophe logo\" href=\"https://docs.apostrophecms.org\">\n      <img src=\"https://img.shields.io/badge/MADE%20FOR%20ApostropheCMS-000000.svg?style=for-the-badge&logo=Apostrophe&labelColor=6516dd\">\n    </a>\n    <a aria-label=\"Join the community on Discord\" href=\"http://chat.apostrophecms.org\">\n      <img alt=\"\" src=\"https://img.shields.io/discord/517772094482677790?color=5865f2&label=Join%20the%20Discord&logo=discord&logoColor=fff&labelColor=000&style=for-the-badge&logoWidth=20\">\n    </a>\n    <a aria-label=\"License\" href=\"https://github.com/apostrophecms/blog/blob/main/LICENSE.md\">\n      <img alt=\"\" src=\"https://img.shields.io/static/v1?style=for-the-badge&labelColor=000000&label=License&message=MIT&color=3DA639\">\n    </a>\n  </p>\n</div>\n\n## Compatibility\nThis version requires the latest ApostropheCMS. When adding this module to an existing project, run `npm update` to ensure all ApostropheCMS modules are up-to-date.\n\n## Installation\n\n```bash\nnpm install @apostrophecms/open-graph\n```\n\n## Use\n\nConfigure `@apostrophecms/open-graph` in `app.js`.\n\n```js\nconst apos = require('apostrophe')({\n  shortName: 'project',\n  modules: {\n    '@apostrophecms/open-graph': {}\n  }\n});\n```\n\n### Setting the `baseUrl`\n\nOpen Graph images *will not be set* with absolute URLs if the `baseUrl` is not set. This should either be set statically in `app.js`, but more likely, in the environment configuration, such as in `data/local.js`. Some social media platforms consider an aboslute URL to be a requirement and *will not accept the image URL without it*.\n\n#### In `app.js` as part of your main Apostrophe app\n```js\nrequire('apostrophe')({\n  shortName: 'mysite',\n  baseUrl: 'https://mysite.com',\n  modules: {\n    // other module configurations\n  }\n});\n```\n#### As part of an environment configuration in `data/local.js`\n```js\n  module.exports = {\n    baseUrl: 'https://mysite.com',\n    modules: {\n      // other environment-specific module configurations\n    }\n  };\n```\n### Opting out of Open Graph Fields\n\nAdding `openGraph: false` to any module will prevent Open Graph fields from being added. Good use cases for this are utility modules, special page types, or piece types that don't have index or show pages.\n\n```js\nrequire('apostrophe')({\n  shortName: 'mysite',\n  baseUrl: 'https://mysite.com',\n  modules: {\n    category: {\n      options: {\n        openGraph: false;\n      }\n    }\n  }\n});\n```\n\nThe following modules opt out of the Open Graph fields by default:\n - `@apostrophecms/global`\n - `@apostrophecms/user`\n - `@apostrophecms/image`\n - `@apostrophecms/image-tag`\n - `@apostrophecms/file`\n - `@apostrophecms/file-tag`\n\n### Field Reference\nThe following are the fields that are added to pieces and pages\n\n|Name |Description  | Module Effected |\n--- | --- | --- \n|`openGraphTitle`|OG Title, populates `<meta property=\"og:title\" />`|`@apostrophecms/doc-type`\n|`openGraphDescription`|OG Description, populates `<meta property=\"og:description\" />`|`@apostrophecms/doc-type`\n|`openGraphType`|OG Type, populates `<meta property=\"og:type\" />`, defaults to 'website'|`@apostrophecms/doc-type`\n|`openGraphImage`|OG Image, populates `<meta property=\"og:image\" />`|`@apostrophecms/doc-type`","readmeFilename":"README.md","_rev":"1-f608ba546275019c81c3ecd7f2b6c50a"}