{"id":16926049,"url":"https://github.com/pedroborges/meta-tags","last_synced_at":"2025-10-06T13:21:17.764Z","repository":{"id":57037412,"uuid":"83442244","full_name":"pedroborges/meta-tags","owner":"pedroborges","description":"HTML meta tags generator for PHP. Supports Open Graph, Twitter Cards, and JSON Linked Data out of the box","archived":false,"fork":false,"pushed_at":"2018-10-03T05:21:48.000Z","size":22,"stargazers_count":45,"open_issues_count":2,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-04T07:51:02.032Z","etag":null,"topics":["head","json-ld","meta-tags","open-graph","php","schema","seo","twitter-cards"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedroborges.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T14:32:31.000Z","updated_at":"2025-04-21T08:00:26.000Z","dependencies_parsed_at":"2022-08-23T21:00:30.224Z","dependency_job_id":null,"html_url":"https://github.com/pedroborges/meta-tags","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pedroborges/meta-tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroborges%2Fmeta-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroborges%2Fmeta-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroborges%2Fmeta-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroborges%2Fmeta-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedroborges","download_url":"https://codeload.github.com/pedroborges/meta-tags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedroborges%2Fmeta-tags/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278616595,"owners_count":26016379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["head","json-ld","meta-tags","open-graph","php","schema","seo","twitter-cards"],"created_at":"2024-10-13T20:28:53.965Z","updated_at":"2025-10-06T13:21:17.741Z","avatar_url":"https://github.com/pedroborges.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Meta Tags [![Release](https://img.shields.io/github/release/pedroborges/meta-tags.svg)](https://github.com/pedroborges/meta-tags/releases) [![Issues](https://img.shields.io/github/issues/pedroborges/meta-tags.svg)](https://github.com/pedroborges/meta-tags/issues)\n\nHTML meta tags generator for PHP. Supports [Open Graph](http://ogp.me), [Twitter Cards](https://dev.twitter.com/cards/overview), and [JSON Linked Data](https://json-ld.org) out of the box.\n\n## Installation\n\n    composer require pedroborges/meta-tags\n\n## Basic Usage\nCreate a new `MetaTags` instance then you are ready to start adding meta tags:\n\n```php\nuse PedroBorges\\MetaTags\\MetaTags;\n\n$tags = new MetaTags;\n\n// \u003ctitle\u003eMy Awesome Site\u003c/title\u003e\n$tags-\u003etitle('My Awesome Site');\n\n// \u003cmeta name=\"description\" content=\"My site description\"\u003e\n$tags-\u003emeta('description', 'My site description');\n\n// \u003clink rel=\"canonical\" href=\"https://pedroborg.es\"\u003e\n// \u003clink rel=\"alternate\" hreflang=\"en\" href=\"https://en.pedroborg.es\"\u003e\n$tags-\u003elink('canonical', 'https://pedroborg.es');\n$tags-\u003elink('alternate', [\n'hreflang' =\u003e 'en',\n'href' =\u003e 'https://en.pedroborg.es'\n]);\n\n// \u003cmeta property=\"og:title\" content=\"The Title\"\u003e\n// \u003cmeta property=\"og:type\" content=\"website\"\u003e\n// \u003cmeta property=\"og:url\" content=\"https://pedroborg.es\"\u003e\n// \u003cmeta property=\"og:image\" content=\"https://pedroborg.es/cover.jpg\"\u003e\n$tags-\u003eog('title', 'The title');\n$tags-\u003eog('type', 'website');\n$tags-\u003eog('url', 'https://pedroborg.es');\n$tags-\u003eog('image', 'https://pedroborg.es/cover.jpg');\n\n// \u003cmeta name=\"twitter:card\" content=\"summary\"\u003e\n// \u003cmeta name=\"twitter:site\" content=\"@pedroborg_es\"\u003e\n$tags-\u003etwitter('card', 'summary');\n$tags-\u003etwitter('site', '@pedroborg_es');\n\n// \u003cscript type=\"application/ld+json\"\u003e\n// {\n//     \"@context\": \"http://schema.org\",\n//     \"@type\": \"Person\",\n//     \"name\": \"Pedro Borges\"\n// }\n// \u003c/script\u003e\n$tags-\u003ejsonld([\n    '@context' =\u003e 'http://schema.org',\n    '@type': 'Person',\n    'name': 'Pedro Borges'\n]);\n```\n\nWhen you are ready to output them, use the `render` method inside your template `\u003chead\u003e` element:\n\n```php\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n    \u003c?php echo $tags-\u003erender() ?\u003e\n```\n\nYou can also render only one tag:\n\n```php\n    \u003c?php echo $tags-\u003erender('title') ?\u003e\n```\n\nOr specify which tags to render:\n\n```php\n    \u003c?php echo $tags-\u003erender(['og', 'twitter', 'json-ld']) ?\u003e\n```\n\nBy default Meta Tag will indent the tags with 4 spaces and use the following order:\n\n1. `\u003ctitle\u003e`\n1. `\u003cmeta\u003e` (General)\n1. `\u003cmeta property=\"og:*\"\u003e` (Open Graph)\n1. `\u003cmeta name=\"twitter:*\"\u003e` (Twitter Cards)\n1. `\u003clink\u003e`\n1. `\u003cscript type=\"application/ld+json\"\u003e` (JSON-LD)\n\nYou can change that when instantiating the `MetaTag` class:\n\n```php\nuse PedroBorges\\MetaTags\\MetaTags;\n\n$tags = new MetaTags(\"\\t\", ['meta', 'title', 'link', 'og', 'twitter', 'json-ld']);\n```\n\n## Change Log\nAll notable changes to this project will be documented at: \u003chttps://github.com/pedroborges/meta-tags/blob/master/changelog.md\u003e\n\n## License\nMeta Tags is open-sourced software licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).\n\nCopyright © 2018 Pedro Borges \u003coi@pedroborg.es\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedroborges%2Fmeta-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedroborges%2Fmeta-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedroborges%2Fmeta-tags/lists"}