{"id":26781708,"url":"https://github.com/walkr/xeo","last_synced_at":"2025-08-11T17:36:36.034Z","repository":{"id":235254467,"uuid":"790412928","full_name":"walkr/xeo","owner":"walkr","description":"Generate SEO, Open Graph \u0026 Twitter Cards HTML meta tags for Phoenix apps.","archived":false,"fork":false,"pushed_at":"2024-04-24T14:04:51.000Z","size":21,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T08:17:30.500Z","etag":null,"topics":["elixir","open-graph-meta-tags","phoenix","seo","twitter-cards"],"latest_commit_sha":null,"homepage":"","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/walkr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-04-22T20:44:07.000Z","updated_at":"2025-03-15T20:53:52.000Z","dependencies_parsed_at":"2024-04-22T21:09:43.468Z","dependency_job_id":null,"html_url":"https://github.com/walkr/xeo","commit_stats":null,"previous_names":["walkr/xeo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkr%2Fxeo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkr%2Fxeo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkr%2Fxeo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walkr%2Fxeo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walkr","download_url":"https://codeload.github.com/walkr/xeo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249704724,"owners_count":21313195,"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","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","open-graph-meta-tags","phoenix","seo","twitter-cards"],"created_at":"2025-03-29T08:17:34.162Z","updated_at":"2025-04-19T13:40:57.881Z","avatar_url":"https://github.com/walkr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xeo\n\nA small library to help with the generation of SEO, Open Graph and Twitter Cards HTML meta tags for [Phoenix](https://www.phoenixframework.org/)-powered apps.\n\n```elixir\n  seo \"/some-url\" do\n    description \"Some seo-friendly description\"\n\n    og_type \"website\"\n    og_title \"Some title\"\n    og_image \"/images/some-image.jpg\"\n    og_site_name \"example.com\"\n    og_description \"Some description\"\n  end\n```\n\n#### Tags Macro Reference\n\nHere are the macros automatically injected, which you can use inside the block supplied\nto the `seo` macro:\n\n- `title`\n- `description`\n- `canonical`\n- `og_type`\n- `og_title`\n- `og_description`\n- `og_image`\n- `og_site_name`\n- `og_url`\n- `twitter_card`\n- `twitter_site`\n- `twitter_title`\n- `twitter_description`\n- `twitter_url`\n- `twitter_image`\n\n## Installation\n\nAdd the `xeo` package to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:xeo, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage\n\nThe typical flow involes (1) using the `Xeo` module, (2) invoking the `Xeo.seo/2` macro\nto define the tags for each page based on its path, and (3) injecting\nthe `MyModule.tags(@conn)` function in the root template, inside the `\u003chead\u003e...\u003c/head\u003e` tag.\n\n### Example\n\n```elixir\ndefmodule MyApp.Seo do\n  use Xeo\n  # Alternatively, `use Xeo, warn: false, pad: 2`\n\n  seo \"/awesome\" do\n    description \"Some seo-friendly description\"\n\n    og_type \"website\"\n    og_title \"Some title\"\n    og_image \"/images/some-image.jpg\"\n    og_site_name \"example.com\"\n    og_description \"Some description\"\n  end\n\n  seo \"/another-page\" ...\nend\n```\n\nUpdate your `root.html.heex`:\n\n```html\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    ...\n    \u003c%= MyApp.Seo.tags(@conn) %\u003e\n  \u003c/head\u003e\n\u003c/html\u003e\n```\n\nNow let's check if it works:\n\n```sh\n$ curl localhost:4000/awesome\n...\n\u003chtml\u003e\n  \u003cmeta name=\"description\" content=\"Some seo-friendly description\" /\u003e\n  \u003cmeta property=\"og:type\" content=\"website\" /\u003e\n  \u003cmeta property=\"og:title\" content=\"Some title\" /\u003e\n  \u003cmeta property=\"og:image\" content=\"/images/some-image.jpg\" /\u003e\n  \u003cmeta property=\"og:site_name\" content=\"example.com\" /\u003e\n  \u003cmeta property=\"og:description\" content=\"Some description\" /\u003e\n...\n```\n\nIn the example above we used the `og_title` and `og_image` macros to define the open graph tags for our `/contact` page.\n\nDo note that the above module will contain a `tags/1` function, which accepts\na phoenix connection and returns the tags associated with the page identified\nby the connection's path.\n\n### Use Options\n\nWhen invoking `use Xeo` you can supply additional options:\n\n- `:warn` (boolean) - show compilation time warnings (default true)\n- `:pad` (integer) - how much whitespace padding to use for html tags (default 4)\n\n### Formatting\n\nFor elegant formatting when using the supplied macros,\nyou can import `:xeo` in your project's formatter file:\n\n```elixir\n# .formatter.exs\n[\n  ...\n  import_deps: [:xeo],\n  ...\n]\n```\n\n### Limitations\n\n- Xeo does not work with dynamic paths, e.g `/resources/:id`, only with static paths which are known at compile time.\n\n## License\n\nXeo is open source under the MIT license. See LICENSE for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkr%2Fxeo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalkr%2Fxeo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalkr%2Fxeo/lists"}