{"id":26206632,"url":"https://github.com/tim-evans/ember-page-title","last_synced_at":"2025-03-12T05:01:55.932Z","repository":{"id":22140003,"uuid":"25471075","full_name":"ember-cli/ember-page-title","owner":"ember-cli","description":"Page title management for Ember.js Apps","archived":false,"fork":false,"pushed_at":"2025-02-22T22:00:16.000Z","size":7763,"stargazers_count":188,"open_issues_count":12,"forks_count":57,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-10T21:05:50.197Z","etag":null,"topics":["addon","ember","fastboot","title"],"latest_commit_sha":null,"homepage":"https://ember-cli.github.io/ember-page-title/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ember-cli.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2014-10-20T14:48:54.000Z","updated_at":"2025-02-22T21:59:30.000Z","dependencies_parsed_at":"2024-01-26T05:07:49.237Z","dependency_job_id":"174394d4-ff79-4603-9336-ca9190f0eefe","html_url":"https://github.com/ember-cli/ember-page-title","commit_stats":{"total_commits":522,"total_committers":51,"mean_commits":"10.235294117647058","dds":0.8620689655172413,"last_synced_commit":"af2428be4d9740a94747f1ebcc3f70d2a52b4806"},"previous_names":["paddle8/ember-document-title","tim-evans/ember-page-title"],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fember-page-title","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fember-page-title/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fember-page-title/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ember-cli%2Fember-page-title/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ember-cli","download_url":"https://codeload.github.com/ember-cli/ember-page-title/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158972,"owners_count":20245672,"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":["addon","ember","fastboot","title"],"created_at":"2025-03-12T05:01:18.685Z","updated_at":"2025-03-12T05:01:55.881Z","avatar_url":"https://github.com/ember-cli.png","language":"JavaScript","funding_links":[],"categories":["Packages","Libraries"],"sub_categories":["a11y","Utilities"],"readme":"## ember-page-title [![Ember Observer Score](https://emberobserver.com/badges/ember-page-title.svg)](https://emberobserver.com/addons/ember-page-title) ![CI](https://github.com/ember-cli/ember-page-title/workflows/CI/badge.svg)\n\nThis addon provides a helper for changing the title of the page you're on.\n\n### Installing via ember-cli\n\n```bash\nember install ember-page-title\n```\n\n### Compatibility\n\n- `ember-source` v4.2 or above\n\n\u003cdetails\u003e\n\u003csummary\u003eFastboot vs Non-Fastboot Notes\u003c/summary\u003e\n\n#### Post Install Setup Notes\n\nAs of v3.0.0 this addon maintains the page title by using the `\u003ctitle\u003e` tag in your document's `\u003chead\u003e`. This is necessary for [FastBoot](https://github.com/tildeio/ember-cli-fastboot) compatibility.\n\n**Non-fastboot apps** should keep the `\u003ctitle\u003e` tag in index.html to ensure that the initial page is valid HTML. The title will be removed and replaced when your app boots.\n\n**Fastboot apps** MUST remove the `\u003ctitle\u003e` tag from index.html. As of v6.0.0 this is done automatically if you use `ember install ember-page-title` to install this addon. Can also be run manually using `ember g ember-page-title` to update the title if FastBoot is installed.\n\n\u003c/details\u003e\n\n### Digging in\n\n[Visit the Docs site](https://ember-cli.github.io/ember-page-title/)\n\n### API\n\n#### `{{page-title}}` Helper\n\n| attribute | type    | default  | description                                                                   |\n| --------- | :------ | :------- | :---------------------------------------------------------------------------- |\n| separator | string  | `\" \\| \"` | Which separator should be displayed _after_ this instance of `{{page-title}}` |\n| prepend   | boolean | true     | If the token should be prepended or appended to the list of tokens            |\n| replace   | boolean | false    | Replace all previous elements with the active                                 |\n| front     | boolean | false    | If the token should always be in the beginning of the resulting title.        |\n\nThe default values for `separator`, `prepend` and `replace` are configurable via `config/environment.js`:\n\n```javascript\n// config/environment.js\n\nmodule.exports = function (environment) {\n  let ENV = {\n    pageTitle: {\n      replace: true,\n    },\n  };\n\n  return ENV;\n};\n```\n\nFor usage in `gts` and `gjs`, the `pageTitle` helper is exported from the index:\n\n```gjs\nimport { pageTitle } from 'ember-page-title';\n\n\u003ctemplate\u003e\n  {{pageTitle \"About\"}}\n  \n  ...\n\u003c/template\u003e\n```\n\n### `page-title` Service\n\nIf you want to be notified when the page title has been updated, you can extend and override the `page-title` service and provide your own `titleDidUpdate` hook. The `titleDidUpdate` hook receives the new title as its sole argument.\n\n```javascript\n// app/services/page-title.js\n\nimport EmberPageTitleService from 'ember-page-title/services/page-title';\n\nexport default class PageTitleService extends EmberPageTitleService {\n  titleDidUpdate(title) {\n    // Do something with the new title.\n  }\n}\n```\n\n### Testing\n\n`assert` the page `title` with the supplied `getPageTitle` test helper:\n\n```javascript\nimport { getPageTitle } from 'ember-page-title/test-support';\n\nmodule('Acceptance | Register Page', function (hooks) {\n  setupApplicationTest(hooks);\n\n  test('visiting /register', async function (assert) {\n    const registerURL = '/register';\n    await visit(registerURL);\n\n    assert.equal(currentURL(), registerURL);\n    assert.equal(getPageTitle(), 'Register | Some Website');\n  });\n});\n```\n\n### TypeScript and Glint\n\nIf your project uses loose-mode templates, you can merge in the template registry interface provided by ember-page-title, \n```ts\n// \u003cyour-app\u003e/types/glint.d.ts\nimport '@glint/environment-ember-loose';\nimport '@glint/environment-ember-template-imports';\n\nimport type PageTitle from 'ember-page-title/template-registry';\n\ndeclare module '@glint/environment-ember-loose/registry' {\n\texport default interface Registry extends PageTitle {\n        /* your local loose-mode entries here */\n\t}\n}\n```\n\nSimilarly, if you rely on a service registry, you'll want to import ember-page-title's service registry and extend from it.\n\n```ts\nimport type PageTitle from 'ember-page-title/service-registry';\n\ndeclare module '@ember/service' {\n  interface Registry extends PageTitle {\n        /* your local service entries here */\n  }\n}\n```\n\nor, if you wish to manage how the service becomes registered yourself, you may import the service:\n```ts\nimport type PageTitle from 'ember-page-title/services/page-title';\n```\n\n### Upgrading notes for 5.x to 6.x\n\n- `ember-page-title` no longer requires the usage of `ember-cli-head`.\n  Please remove `{{head-layout}}` from your application's `application.hbs` route template.\n- `{{title}}` has been removed, please rename to `{{page-title}}`.\n\n# Contributing\n\nContributors are welcome! Please provide a reproducible test case. Details will be worked out on a case-per-case basis. Maintainers will get in touch when they can, so delays are possible. For contribution guidelines, see the [code of conduct](https://github.com/ember-cli/ember-page-title/blob/master/CODE_OF_CONDUCT.md).\n\n### Publishing Documentation\n\nTo publish documentation, run the following command:\n\n```bash\nember github-pages:commit --message \"update documentation\"\ngit push origin gh-pages:gh-pages\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-evans%2Fember-page-title","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftim-evans%2Fember-page-title","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftim-evans%2Fember-page-title/lists"}