{"id":13508597,"url":"https://github.com/wemake-services/ecto_autoslug_field","last_synced_at":"2026-03-13T01:02:15.268Z","repository":{"id":38339242,"uuid":"63813498","full_name":"wemake-services/ecto_autoslug_field","owner":"wemake-services","description":"Automatically create slugs for Ecto schemas.","archived":false,"fork":false,"pushed_at":"2026-01-21T09:40:37.000Z","size":388,"stargazers_count":153,"open_issues_count":3,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-01-21T21:25:07.892Z","etag":null,"topics":["ecto","ecto-extension","ecto-types","elixir","elixir-lang","elixir-library","slugs"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/ecto_autoslug_field","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/wemake-services.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"wemake-services","custom":"https://boosty.to/sobolevn"}},"created_at":"2016-07-20T20:49:48.000Z","updated_at":"2026-01-21T09:40:34.000Z","dependencies_parsed_at":"2024-03-06T16:28:12.750Z","dependency_job_id":"2f3551b2-9fb4-4d2a-9a20-e80a1759817e","html_url":"https://github.com/wemake-services/ecto_autoslug_field","commit_stats":{"total_commits":230,"total_committers":14,"mean_commits":"16.428571428571427","dds":0.4695652173913043,"last_synced_commit":"b0f734d4a09c41ca6ee046b2ae5d6fbe15da56cd"},"previous_names":["sobolevn/ecto_autoslug_field"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/wemake-services/ecto_autoslug_field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wemake-services%2Fecto_autoslug_field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wemake-services%2Fecto_autoslug_field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wemake-services%2Fecto_autoslug_field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wemake-services%2Fecto_autoslug_field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wemake-services","download_url":"https://codeload.github.com/wemake-services/ecto_autoslug_field/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wemake-services%2Fecto_autoslug_field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30452878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T21:31:01.033Z","status":"ssl_error","status_checked_at":"2026-03-12T21:30:43.161Z","response_time":114,"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":["ecto","ecto-extension","ecto-types","elixir","elixir-lang","elixir-library","slugs"],"created_at":"2024-08-01T02:00:55.410Z","updated_at":"2026-03-13T01:02:15.184Z","avatar_url":"https://github.com/wemake-services.png","language":"Elixir","funding_links":["https://github.com/sponsors/wemake-services","https://boosty.to/sobolevn"],"categories":["Miscellaneous"],"sub_categories":[],"readme":"# EctoAutoslugField\n\n[![Build Status](https://github.com/sobolevn/ecto_autoslug_field/workflows/test/badge.svg?branch=master\u0026event=push)](https://github.com/sobolevn/ecto_autoslug_field/actions?query=workflow%3Atest)\n[![Coverage Status](https://coveralls.io/repos/github/sobolevn/ecto_autoslug_field/badge.svg?branch=master)](https://coveralls.io/github/sobolevn/ecto_autoslug_field?branch=master)\n[![Module Version](https://img.shields.io/hexpm/v/ecto_autoslug_field.svg)](https://hex.pm/packages/ecto_autoslug_field)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ecto_autoslug_field/)\n[![License](https://img.shields.io/hexpm/l/ecto_autoslug_field.svg)](https://github.com/sobolevn/ecto_autoslug_field/blob/master/LICENSE)\n\n`ecto_autoslug_field` is a reusable [`Ecto`](https://github.com/elixir-ecto/ecto) library which can automatically create slugs from other fields. We use [`slugify`](https://github.com/jayjun/slugify) as a default slug-engine.\n\nWe only depend on the `ecto` package (we do not deal with `ecto_sql` at all).\nWe support `ecto \u003e= 3.7 and ecto \u003c 4`!\n\nSee [this blog post](https://sobolevn.me/2017/07/creating-slugs-for-ecto-schemas)\nfor more information.\n\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:ecto_autoslug_field, \"~\u003e 3.1\"}\n  ]\nend\n```\n\n\n## Options\n\nThere are several options to configure.\n\nRequired:\n\n- `:to` - represents the slug field name where to save value to\n\nOptional:\n\n- `:from` - represents the source fields from which to build slug, if this option is not set you have to override `get_sources/2` function\n- `:always_change` - if this option is set slug will be recreated from the given sources each time `maybe_generate_slug` function is called\n\n\n## Functions\n\n- `get_sources/2` - this function is used to get sources for the slug, [docs](https://hexdocs.pm/ecto_autoslug_field/EctoAutoslugField.SlugBase.html#get_sources/2).\n- `build_slug/2` - this function is a place to modify the result slug, [docs](https://hexdocs.pm/ecto_autoslug_field/EctoAutoslugField.SlugBase.html#build_slug/2).\n\n\n## Examples\n\nThe simplest example:\n\n```elixir\ndefmodule EctoSlugs.Blog.Article.TitleSlug do\n  use EctoAutoslugField.Slug, from: :title, to: :slug\nend\n\ndefmodule EctoSlugs.Blog.Article do\n  use Ecto.Schema\n  import Ecto.Changeset\n  alias EctoSlugs.Blog.Article\n  alias EctoSlugs.Blog.Article.TitleSlug\n\n  schema \"blog_articles\" do\n    field :breaking, :boolean, default: false\n    field :content, :string\n    field :title, :string\n\n    field :slug, TitleSlug.Type\n\n    timestamps()\n  end\n\n  def changeset(model, params \\\\ :invalid) do\n    model\n    |\u003e cast(params, [:title, :content, :breaking])\n    |\u003e validate_required([:title, :content])\n    |\u003e unique_constraint(:title)\n    |\u003e TitleSlug.maybe_generate_slug()\n    |\u003e TitleSlug.unique_constraint()\n  end\nend\n```\n\nSee [this tutorial](https://sobolevn.me/2017/07/creating-slugs-for-ecto-schemas)\nfor some more examples.\n\n\n## Changelog\n\nSee [CHANGELOG.md](./CHANGELOG.md).\n\n\n## Copyright and License\n\nCopyright (c) 2016 Nikita Sobolev\n\nThis library is released under the MIT License. See the [LICENSE.md](./LICENSE.md) file\nfor further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwemake-services%2Fecto_autoslug_field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwemake-services%2Fecto_autoslug_field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwemake-services%2Fecto_autoslug_field/lists"}