Slug
- Dominant language
- Elixir
- Stars
- 6
- Forks
- 0
- Avg merge
- 2h 27m
- Merged PRs (30d)
- 1
Description
When crafting Search Engine friendly `URLs` e.g. for a `website` or `blog`
we need to include as many useful keywords as practical in the URL up to a length limit; e.g: `64 char`
If the `blog` post / `page` title is "How To Do What You Love And Get Paid?" (`37 char`)
The `slug` could be: "how-to-do-what-you-love-and-get-paid"
This is just:
```elixir
"How To Do What You Love And Get Paid?"
|> String.replace("?", "") # remove question marks from URLs
|> String.downcase() # Use only lowercase letters
|> String.replace(" ", "-")
> "how-to-do-what-you-love-and-get-paid"
```
But there appears to be more to this: (fairly predictably)
https://stackoverflow.com/questions/39394916/how-to-truncate-a-string-in-elixir
So we need to collect _all_ the requirements, and ideally match what `Wordpress` are doing.
Then write our own function and publish it!
If you're interested in working on this function, please drop a comment. 💬
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.