Skip to content

Slug #23

@nelsonic

Description

@nelsonic

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:

"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. 💬

Metadata

Metadata

Assignees

No one assigned

    Labels

    T2hTime Estimate 2 HoursdiscussShare your constructive thoughts on how to make progress with this issuedocumentationImprovements or additions to documentationelixirPull requests that update Elixir codeenhancementNew feature or enhancement of existing functionalityhelp wantedIf you can help make progress with this issue, please comment!priority-2Second highest priority, should be worked on as soon as the Priority-1 issues are finishedresearchResearch required; be specifictechnicalA technical issue that requires understanding of the code, infrastructure or dependencies

    Type

    No type

    Projects

    Status

    No status

    Status

    More ToDo ThanCanEver Be Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions