chore: basic menu migration, not finished

This commit is contained in:
Roman Hotsiy
2023-10-02 23:27:31 +08:00
committed by mDuo13
parent 0e181b3790
commit 595b470679
3 changed files with 343 additions and 0 deletions

14
content/@theme/helpers.ts Normal file
View 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;
}