Skip to content

Commit

Permalink
Use slugify
Browse files Browse the repository at this point in the history
  • Loading branch information
mitjapotocin committed Oct 19, 2023
1 parent 3d53c8b commit d68ab35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"react-dom": "18.2.0",
"remark-gfm": "^3.0.1",
"remark-unwrap-images": "^3.0.1",
"slugify": "^1.6.6",
"styled-components": "^5.3.6",
"typescript": "4.9.3"
},
Expand Down
9 changes: 4 additions & 5 deletions utils/slugify.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export default function slugify(title) {
return title
.replace(/ /g, "-")
.replace(/[.,\/#!?%\^&\*;:{}=\_`~()]/g, "")
.toLowerCase();
import slugify from "slugify";

export default function _slugify(title) {
return slugify(title, { lower: true });
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4962,6 +4962,11 @@ slice-ansi@^4.0.0:
astral-regex "^2.0.0"
is-fullwidth-code-point "^3.0.0"

slugify@^1.6.6:
version "1.6.6"
resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.6.tgz#2d4ac0eacb47add6af9e04d3be79319cbcc7924b"
integrity sha512-h+z7HKHYXj6wJU+AnS/+IH8Uh9fdcX1Lrhg1/VMdf9PwoBQXFcXiAdsy2tSK0P6gKwJLXp02r90ahUCqHk9rrw==

sort-keys-length@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz"
Expand Down

1 comment on commit d68ab35

@vercel
Copy link

@vercel vercel bot commented on d68ab35 Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

orange-web2 – ./

orange-web2.vercel.app
orange-web2-git-main-biolab.vercel.app
orange-web2-biolab.vercel.app

Please sign in to comment.