{"id":15450390,"url":"https://github.com/photogabble/eleventy-plugin-tag-normaliser","last_synced_at":"2026-01-11T01:53:37.093Z","repository":{"id":65482446,"uuid":"592964141","full_name":"photogabble/eleventy-plugin-tag-normaliser","owner":"photogabble","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-26T11:43:18.000Z","size":114,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T17:57:50.529Z","etag":null,"topics":["11ty","11ty-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@photogabble/eleventy-plugin-tag-normaliser","language":"JavaScript","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/photogabble.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-24T22:49:33.000Z","updated_at":"2023-01-25T14:33:54.000Z","dependencies_parsed_at":"2023-02-14T17:01:30.051Z","dependency_job_id":null,"html_url":"https://github.com/photogabble/eleventy-plugin-tag-normaliser","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photogabble%2Feleventy-plugin-tag-normaliser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photogabble%2Feleventy-plugin-tag-normaliser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photogabble%2Feleventy-plugin-tag-normaliser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/photogabble%2Feleventy-plugin-tag-normaliser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/photogabble","download_url":"https://codeload.github.com/photogabble/eleventy-plugin-tag-normaliser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246785453,"owners_count":20833494,"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":["11ty","11ty-plugin"],"created_at":"2024-10-01T21:05:00.044Z","updated_at":"2026-01-11T01:53:37.062Z","avatar_url":"https://github.com/photogabble.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tag Normaliser Plugin\n\nA lightweight library for making available `strToSlug` and `slugToStr` filters to your [Eleventy](https://www.11ty.dev/) powered project. Behind the scenes there is a configurable \"Tag Atlas\" that keeps track of and normalises your tags.\n\nThis is known to work against [v1.0.2 of Eleventy](https://github.com/11ty/eleventy/releases/tag/v1.0.2).\n\n## Install\n\n```\nnpm i @photogabble/eleventy-plugin-tag-normaliser\n```\n\n## Configuration\n\nThe tag atlas provides three configuration options: `ignore`, `similar` and `slugify`.\n\n```ts\ninterface Options {\n  slugify: Function;\n  ignore: Array\u003cstring\u003e;\n  similar: Record\u003cstring, Array\u003cstring\u003e\u003e;\n}\n```\n\n### Slugify\nBy default, this library depends upon the [slugify](https://www.npmjs.com/package/slugify) library for providing the string to slug functionality. If you already have your own function or configured instance of slufify for your project that you would rather use then you may pass that through via this attribute, else, slugify will be loaded with the following options:\n\n```js\nconst options = {\n  lower: true,\n  replacement: '-',\n  remove: /[\u0026,+()$~%.'\":*?!\u003c\u003e{}#/]/g,\n};\n```\n\n### Ignored Tags\n\nThese are tags that you do not want the tag atlas to modify when converting from slug to string. For example `DOScember` will by default become `dos-cember` excluding it will ensure the slug becomes `doscember` and the title remains `DOScember`.\n\nFor example these will all eval as true:\n\n```js\n// ignore: ['JavaScript', 'JS'],\n\nstrToSlug('JS') === 'js';\nslugToStr('js') === 'JS';\n\nstrToSlug('JavaScript') === 'javascript';\nslugToStr('javascript') === 'JavaScript';\n```\n\n### Similar Tags\n\nThis is how you teach the Tag Atlas tag similarity. For example, you might want all instances of `JS` to point to `JavaScript`.\n\n```js\n// similar: {'JavaScript': ['JS']},\n\nstrToSlug('JS') === 'java-script';\nslugToStr('js') === 'Java Script';\n\nstrToSlug('JavaScript') === 'java-script';\nslugToStr('java-script') === 'Java Script';\n```\n\nFrom the above you can see why you would want to combine `ignore: ['JavaScript']` so that `java-script` did not become `Java Script`.\n\n## Usage\n\nIn your Eleventy config file (defaults to `.eleventy.js`):\n\n```js\nmodule.exports = (eleventyConfig) =\u003e {\n  const config = {\n    ignore: ['JavaScript', 'PHP'],\n    similar: {'JavaScript': ['JS']},\n  };\n  eleventyConfig.addPlugin(require('@photogabble/eleventy-plugin-tag-normaliser'), config);\n};\n```\n\nYou will now have `strToSlug` and `slugToStr` filters available for use in your templates as well as a memoized instance of the `TagAtlas` available as global data via the `tagAtlas` value. For example:\n\n```js\nconst atlas = eleventyConfig.globalData.tileAtlas;\n```\n\n## License\nThis 11ty plugin is open-sourced software licensed under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphotogabble%2Feleventy-plugin-tag-normaliser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphotogabble%2Feleventy-plugin-tag-normaliser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphotogabble%2Feleventy-plugin-tag-normaliser/lists"}