arnes.space-bagatto/utils.janet
2021-07-29 21:53:42 +02:00

13 lines
404 B
Janet

(defn slugify-content
```
Converts a path from the content folder into the path of the rendered html.
```
[site &opt item]
(when item
(let [parts (string/split "/" (item :path))
file (last parts)]
(string/join [;(slice parts 1 -2) (string (first (string/split "." file)) ".html")] "/"))))
(comment
(slugify-content {} "content/posts/2021-07-07--let-there-be-light.md"))