We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes it is necessary to convert a title to slug - it could be a blog post title, or a section title. It would be nice to have a helper function in easy-hugo that converts selected text to a slug in the same way as hugo (goldmark?) does: https://discourse.gohugo.io/t/difference-in-auto-generated-heading-anchor-names-between-previous-versions-and-v0-60-0-or-higher/22076
The text was updated successfully, but these errors were encountered:
I wrote an initial version, feel free to improve it:
(defun hugo-slugify (start end) (interactive "r") (if (use-region-p) (let ((regionp (buffer-substring start end))) (save-excursion (delete-region start end) (insert (replace-regexp-in-string "[^a-z0-9-]" "" (replace-regexp-in-string "\s+" "-" (downcase regionp) )))))))
Sorry, something went wrong.
Hi @max-arnold . Thank you for comment. I've implemented easy-hugo-slugify at baead14. I hope you find it useful.
No branches or pull requests
Sometimes it is necessary to convert a title to slug - it could be a blog post title, or a section title. It would be nice to have a helper function in easy-hugo that converts selected text to a slug in the same way as hugo (goldmark?) does: https://discourse.gohugo.io/t/difference-in-auto-generated-heading-anchor-names-between-previous-versions-and-v0-60-0-or-higher/22076
The text was updated successfully, but these errors were encountered: