(self, text: str)
| 149 | return t.strip() |
| 150 | |
| 151 | def slugify(self, text: str) -> str: |
| 152 | text = text.lower() |
| 153 | text = re.sub(r"[^\w\s-]", "", text) |
| 154 | text = re.sub(r"[\s_]+", "-", text) |
| 155 | text = re.sub(r"-+", "-", text) |
| 156 | return text.strip("-")[:80] |
| 157 | |
| 158 | def save_post(self, post: dict) -> Tuple[Optional[Path], Optional[dict]]: |
| 159 | """Save a single post as a Markdown file.""" |