mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-24 05:35:51 +00:00
chore: basic menu migration, not finished
This commit is contained in:
14
content/@theme/helpers.ts
Normal file
14
content/@theme/helpers.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Slugify function, has to match the formula used in interactive-tutorial.js
|
||||
*/
|
||||
export function slugify(s) {
|
||||
const unacceptable_chars = /[^A-Za-z0-9._ ]+/g;
|
||||
const whitespace_regex = /\s+/g;
|
||||
s = s.replace(unacceptable_chars, '');
|
||||
s = s.replace(whitespace_regex, '_');
|
||||
s = s.toLowerCase();
|
||||
if (!s) {
|
||||
s = '_';
|
||||
}
|
||||
return s;
|
||||
}
|
||||
Reference in New Issue
Block a user