GitHub Action
commited on
Commit
·
53a88a8
1
Parent(s):
3f7edae
Sync from GitHub with Git LFS
Browse files
scripts/publish_to_hashnode.py
CHANGED
|
@@ -118,7 +118,9 @@ def main(force=False):
|
|
| 118 |
|
| 119 |
for md_file in md_files:
|
| 120 |
name = md_file.stem
|
| 121 |
-
slug =
|
|
|
|
|
|
|
| 122 |
h = file_hash(md_file)
|
| 123 |
|
| 124 |
if not force and name in published and published[name]["hash"] == h:
|
|
|
|
| 118 |
|
| 119 |
for md_file in md_files:
|
| 120 |
name = md_file.stem
|
| 121 |
+
slug = re.sub(r'[^a-z0-9-]', '-', name.lower())
|
| 122 |
+
slug = re.sub(r'-+', '-', slug).strip('-')
|
| 123 |
+
slug = slug[:250]
|
| 124 |
h = file_hash(md_file)
|
| 125 |
|
| 126 |
if not force and name in published and published[name]["hash"] == h:
|