Flesh out page structure
This commit is contained in:
parent
0bae8c01f8
commit
85e79a8090
5 changed files with 105 additions and 25 deletions
13
utils.janet
Normal file
13
utils.janet
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(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"))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue