{"id":17748575,"url":"https://github.com/tubbo/titleist","last_synced_at":"2026-05-17T03:38:33.491Z","repository":{"id":56897043,"uuid":"60038144","full_name":"tubbo/titleist","owner":"tubbo","description":"Browser title engine for Rails applications utilizing i18n","archived":false,"fork":false,"pushed_at":"2023-12-16T08:20:28.000Z","size":576,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T18:59:13.488Z","etag":null,"topics":["rails","web"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/tubbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","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":"2016-05-30T20:48:30.000Z","updated_at":"2020-07-11T16:52:49.000Z","dependencies_parsed_at":"2023-12-16T09:35:27.318Z","dependency_job_id":"4bdfe8a6-e0ab-4a60-8758-7c48faae9869","html_url":"https://github.com/tubbo/titleist","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"3d46fba017824d512d62a2ef823a91510b3eec48"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubbo%2Ftitleist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubbo%2Ftitleist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubbo%2Ftitleist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tubbo%2Ftitleist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tubbo","download_url":"https://codeload.github.com/tubbo/titleist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246598150,"owners_count":20802972,"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":["rails","web"],"created_at":"2024-10-26T10:07:49.913Z","updated_at":"2025-10-28T01:07:02.005Z","avatar_url":"https://github.com/tubbo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Titleist\n\n![Improve Your Swing](https://www.titleist.com/build/assets/images/logo-titleist.svg)\n\n[![Tests](https://github.com/tubbo/titleist/workflows/Tests/badge.svg)](https://github.com/tubbo/titleist/actions)\n[![Maintainability](https://codeclimate.com/github/tubbo/titleist/badges/gpa.svg)](https://codeclimate.com/github/tubbo/titleist)\n[![Test Coverage](https://codeclimate.com/github/tubbo/titleist/badges/coverage.svg)](https://codeclimate.com/github/tubbo/titleist/coverage)\n\nA powerful title helper for [Rails][] apps using [i18n][], with the\nability to override practically everything.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'titleist'\n```\n\nAnd then run:\n\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install titleist\n```\n\n## Usage\n\nRun the generator to get an example locale file and titles appearing in\nyour `\u003ctitle\u003e` tag.\n\n```bash\nrails generate titleist\n```\n\n### Configuration\n\nEdit your **config/locales/titleist.en.yml** file to add your own titles and format:\n\n```yaml\nen:\n  titleist:\n    format: '%{page} | %{app}'\n  layouts:\n    application:\n      title: My Application\n  posts:\n    index:\n      title: View All Posts\n    show:\n      title: View Post\n```\n\n### Helpers\n\nYou can also use our fancy title helpers to generate your own titles.\n\nFor the full monty:\n\n```erb\n\u003ctitle\u003e\u003c%= title %\u003e\u003c/title\u003e\n\u003c!-- or... --\u003e\n\u003c%= title_tag %\u003e\n```\n\nPage titles only:\n\n```erb\n\u003ch1\u003e\u003c%= page_title %\u003e\u003c/h1\u003e\n```\n\nOr the app title only:\n\n```erb\n\u003cp\u003eCopyright \u0026copy; 2015 \u003c%= app_title %\u003e\u003c/p\u003e\n```\n\nThese methods are also available in the controller layer.\n\n### Context\n\nYou can provide title context in your controllers for displaying things\nlike model data in the title.\n\n```ruby\nclass PostsController \u003c ApplicationController\n  def show\n    @post = Post.find params[:id]\n    title[:post] = @post.title\n  end\nend\n```\n\nBy default, all `params` are added to this context, and they can be read\nby their keys in your i18n translations:\n\n```yaml\nen:\n  posts:\n    show:\n      title: '%{post} (ID: %{post_id})'\n```\n\n### Overriding\n\nThe entire page title can be overridden if you wish:\n\n```ruby\nclass PostsController \u003c ApplicationController\n  def show\n    @post = Post.find params[:id]\n    title.page = @post.title\n  end\nend\n```\n\nOr the app title:\n\n```ruby\nclass PostsController \u003c ApplicationController\n  def show\n    @post = Post.find params[:id]\n    title.page = @post.title\n    title.app = current_site.name\n  end\nend\n```\n\n### Defaults\n\nTitelist attempts to derive default values if you do not configure them\nin locales. For example, if the `.posts.new.title` translation can't be\nfound, the default title would be `\"New Post\"`, based on the name of the\ncontroller and action.\n\nThe default title of your app is the name of the application module,\nwhich is also what Rails considers to be the \"app name\".\n\n## Contributing\n\nPlease include tests and submit changes in a pull request. Read our\n[Code of Conduct][] to find more information on expected behavior and\nhow to resolve issues. All changes to the codebase are verified using\nthe CI build, and a failing build cannot be merged to 'master'. In\naddition, Travis is responsible for building and pushing new gem\nversions to [RubyGems][] when a new tag is pushed to Github.  This\nlibrary follows [Semantic Versioning][] to communicate the level of\nchange to end users.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License][].\n\n[Rails]: http://rubyonrails.org\n[i18n]: http://guides.rubyonrails.org/i18n.html\n[Code of Conduct]: CODE_OF_CONDUCT.md\n[RubyGems]: http://rubygems.org\n[Semantic Versioning]: http://semver.org\n[MIT License]: MIT-LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubbo%2Ftitleist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftubbo%2Ftitleist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubbo%2Ftitleist/lists"}