{"id":13508044,"url":"https://github.com/hlongvu/phoenix_meta_tags","last_synced_at":"2026-02-19T08:02:50.954Z","repository":{"id":46958296,"uuid":"158148076","full_name":"hlongvu/phoenix_meta_tags","owner":"hlongvu","description":"Phoenix library helps generating meta tags for website.","archived":false,"fork":false,"pushed_at":"2024-03-01T21:30:13.000Z","size":43,"stargazers_count":30,"open_issues_count":5,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-27T10:40:36.321Z","etag":null,"topics":["elixir","meta","metatags","opengrah","phoenix","tags"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hlongvu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-19T02:01:23.000Z","updated_at":"2024-06-26T08:55:00.000Z","dependencies_parsed_at":"2024-05-01T16:19:51.874Z","dependency_job_id":"ff0a6690-3580-4bf5-b392-ed655733fa2a","html_url":"https://github.com/hlongvu/phoenix_meta_tags","commit_stats":{"total_commits":32,"total_committers":6,"mean_commits":5.333333333333333,"dds":0.40625,"last_synced_commit":"4239be334d1d1fa0658466bdc3e69f4a03bf7e6c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/hlongvu/phoenix_meta_tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlongvu%2Fphoenix_meta_tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlongvu%2Fphoenix_meta_tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlongvu%2Fphoenix_meta_tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlongvu%2Fphoenix_meta_tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlongvu","download_url":"https://codeload.github.com/hlongvu/phoenix_meta_tags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlongvu%2Fphoenix_meta_tags/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elixir","meta","metatags","opengrah","phoenix","tags"],"created_at":"2024-08-01T02:00:46.652Z","updated_at":"2026-02-19T08:02:50.936Z","avatar_url":"https://github.com/hlongvu.png","language":"Elixir","funding_links":[],"categories":["Framework Components"],"sub_categories":[],"readme":"## Phoenix Meta Tags\n\n[![Module Version](https://img.shields.io/hexpm/v/phoenix_meta_tags.svg)](https://hex.pm/packages/phoenix_meta_tags)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/phoenix_meta_tags/)\n[![Total Download](https://img.shields.io/hexpm/dt/phoenix_meta_tags.svg)](https://hex.pm/packages/phoenix_meta_tags)\n[![License](https://img.shields.io/hexpm/l/phoenix_meta_tags.svg)](https://github.com/hlongvu/phoenix_meta_tags/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/hlongvu/phoenix_meta_tags.svg)](https://github.com/hlongvu/phoenix_meta_tags/commits/master)\n\n\u003c!-- MDOC !--\u003e\n\nThis is a library helps generate meta tags for a website.\n\n### Default Usage\n\nFrom a struct like this:\n\n```elixir\n%{\n    title: \"Phoenix Title\",\n    description: \"Phoenix Descriptions\",\n    url: \"https://phoenix.meta.tags\",\n    image: \"https://phoenix.meta.tags/logo.png\"\n}\n```\n\nwill become:\n\n```html\n# Default tags\n\u003ctitle\u003ePhoenix Title\u003c/title\u003e\n\u003cmeta content=\"Phoenix Title\" name=\"title\"\u003e\n\u003cmeta content=\"Phoenix Descriptions\" name=\"description\"\u003e\n\n#Open Graph tags\n\u003cmeta content=\"website\" property=\"og:type\"\u003e\n\u003cmeta content=\"https://phoenix.meta.tags\" property=\"og:url\"\u003e\n\u003cmeta content=\"Phoenix Title\" property=\"og:title\"\u003e\n\u003cmeta content=\"Phoenix Descriptions\" property=\"og:description\"\u003e\n\u003cmeta content=\"https://phoenix.meta.tags/logo.png\" property=\"og:image\"\u003e\n\n#Twitter tags\n\u003cmeta content=\"summary_large_image\" name=\"twitter:card\"\u003e\n\u003cmeta content=\"https://phoenix.meta.tags\" name=\"twitter:url\"\u003e\n\u003cmeta content=\"Phoenix Title\" name=\"twitter:title\"\u003e\n\u003cmeta content=\"Phoenix Descriptions\" name=\"twitter:description\"\u003e\n\u003cmeta content=\"https://phoenix.meta.tags/logo.png\" name=\"twitter:image\"\u003e\n\n```\n\n### Advanced Usage\nOther key value of tags map will be rendered individually by key. Nested map will be rendered by *flat-representation* of keys. For example:\n\n\n```elixir\nmap = %{\n  title: \"Phoenix Title\",\n  description: \"Phoenix Descriptions\",\n  url: \"https://phoenix.meta.tags\",\n  image: \"https://phoenix.meta.tags/logo.png\",\n  fb: %{\n    name: \"facebook\",\n    size: %{\n      width: 100,\n      height: 200,\n      position: %{\n        x: 10,\n        y: 15\n      }\n    }\n  }\n}\n```\n\nIn addition to default tags like above example, the rendered tags will have more:\n\n```html\n\u003cmeta content=\"facebook\" property=\"fb:name\"\u003e\n\u003cmeta content=100 property=\"fb:size:width\"\u003e\n\u003cmeta content=200 property=\"fb:size:height\"\u003e\n\u003cmeta content=10 property=\"fb:size:position:x\"\u003e\n\u003cmeta content=15 property=\"fb:size:position:y\"\u003e\n```\n\nInstead of a nested map, you can also use a string-key map, this also delivers the same result:\n\n```elixir\nmap = %{\n  \"title\" =\u003e \"PhoenixTags\",\n  \"fb:name\" =\u003e \"facebook\",\n  \"fb:size:width\" =\u003e 100,\n  \"fb:size:height\" =\u003e 200,\n  \"fb:size:position:x\" =\u003e 10,\n  \"fb:size:position:y\" =\u003e 15\n}\n\n```\n\n### Tag Value Override\n\nIn default rendering, the **og:title** tag will get value from **title**. If you re-define **og:title** value, the new value will be override the default **title** value. For example:\n\n```elixir\nmap = %{\n  title: \"Phoenix Title\",\n  og: %{\n    title: \"Override\"\n  }\n}\n```\n\nWill have output:\n\n```html\n\u003ctitle\u003ePhoenix Title\u003c/title\u003e\n\u003cmeta content=\"Phoenix Title\" name=\"title\"\u003e\n\u003cmeta content=\"Override\" property=\"og:title\"\u003e\n```\n\n## Installation\n\nThe package can be installed by adding `:phoenix_meta_tags` to your list of\ndependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:phoenix_meta_tags, \"\u003e= 0.1.9\"}\n  ]\nend\n```\n\nIn your Web Module add this:\n\n```elixir\ndef view do\n  quote do\n    ...\n    use PhoenixMetaTags.TagView # Add this\n  end\nend\n\ndef controller do\n  quote do\n    ...\n    use PhoenixMetaTags.TagController # Add this\n  end\nend\n```\n\nAlso put this render function inside your **\\\u003chead\\\u003e** tag of `app.html.eex`:\n\n```elixir\n\u003chead\u003e\n    \u003c%= render_tags_all(assigns[:meta_tags] || %{})%\u003e # Add this\n\u003c/head\u003e\n```\n\n## Usage\n\nWherever you want to render meta tags, jut put it before render your view:\n\n```elixir\nconn\n|\u003e put_meta_tags(%{\n  title: \"Phoenix Title\",\n  description: \"Phoenix Descriptions\",\n  url: \"https://phoenix.meta.tags\",\n  image: \"https://phoenix.meta.tags/logo.png\"\n})\n|\u003erender(\"index.html\")\n```\n\nOr, use it as a plug:\n\n```elixir\n@meta %{\n  title: \"Phoenix Title\",\n  description: \"Phoenix Descriptions\",\n  url: \"https://phoenix.meta.tags\",\n  image: \"https://phoenix.meta.tags/logo.png\"\n}\n\nplug :put_meta_tags, @meta\n```\n\n\n### Default value\nYou can put the default value for meta tags in your config file. This config will be merge with runtime tags before rendering.\n\n```elixir\nconfig :phoenix_meta_tags,\n  title: \"Phoenix Title Default\",\n  description: \"Phoenix Descriptions Default\",\n  url: \"https://phoenix.meta.tags.default\",\n  image: \"https://phoenix.meta.tags.default/logo.png\",\n  \"og:text\": \"Hello Open Graph\",\n  fb: %{\n    name: \"facebook\",\n    size: %{\n      width: 100,\n      height: 200,\n      position: %{\n        x: 10,\n        y: 15\n      }\n    }\n  }\n```\n\u003c!-- MDOC !--\u003e\n\n## Copyright and License\n\nCopyright (c) 2018 hlongvu\n\nThis work is free. You can redistribute it and/or modify it under the\nterms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlongvu%2Fphoenix_meta_tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlongvu%2Fphoenix_meta_tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlongvu%2Fphoenix_meta_tags/lists"}