From 020c1e77489b772f854bb3288b9c8d2818a6bf9d Mon Sep 17 00:00:00 2001
From: EuAndreh <eu@euandre.org>
Date: Fri, 18 Apr 2025 02:17:12 -0300
Subject: git mv src/content/* src/content/en/

---
 .../en/pastebins/2021/04/03/naive-slugify-js.adoc  | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc

(limited to 'src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc')

diff --git a/src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc b/src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc
new file mode 100644
index 0000000..184ce97
--- /dev/null
+++ b/src/content/en/pastebins/2021/04/03/naive-slugify-js.adoc
@@ -0,0 +1,28 @@
+= JavaScript naive slugify
+:updatedat: 2021-08-15
+
+[source,javascript]
+----
+const s = "Pézão: açaí, saci-pererê.";
+
+const slugify = s =>
+  s
+    .toLowerCase()
+    .replaceAll(":", "")
+    .replaceAll(".", "")
+    .replaceAll(",", "")
+    .replaceAll("-", "")
+    .replaceAll("á", "a")
+    .replaceAll("ã", "a")
+    .replaceAll("à", "a")
+    .replaceAll("é", "e")
+    .replaceAll("ê", "e")
+    .replaceAll("í", "i")
+    .replaceAll("ó", "o")
+    .replaceAll("ô", "o")
+    .replaceAll("ú", "u")
+    .replaceAll("ü", "u")
+    .replaceAll("ç", "c");
+
+console.log(slugify(s));
+----
-- 
cgit v1.2.3

