summaryrefslogtreecommitdiff
path: root/transformations.go
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2023-05-01 13:03:03 +0200
committerNicolas Paul <n@nc0.fr>2023-05-01 13:03:03 +0200
commitf57c0d15c931563a55abdc9cea72d189a24f7456 (patch)
tree97a7cd740da179b0a2f160a92bf2ec9da9ed6cd9 /transformations.go
parent314db62804a5696aa81ebf0a680cc8f9e2e46ede (diff)
Add slug to HTML templates
Diffstat (limited to 'transformations.go')
-rw-r--r--transformations.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/transformations.go b/transformations.go
index 14c57b3..aa2fc30 100644
--- a/transformations.go
+++ b/transformations.go
@@ -42,7 +42,8 @@ func TransformDirectory(o string) error {
// TransformMarkdownFile generates the corresponding HTML document from a
// Markdown file.
-func TransformMarkdownFile(i, o string) error {
+// s corresponds to the slug of the document.
+func TransformMarkdownFile(i, o, s string) error {
raw, err := os.ReadFile(i)
if err != nil {
return err
@@ -75,7 +76,7 @@ func TransformMarkdownFile(i, o string) error {
renderer := html.NewRenderer(html.RendererOptions{Flags: htmlFlags})
html := markdown.Render(ast, renderer)
- c, err := GenerateHTML(fm, string(html))
+ c, err := GenerateHTML(fm, s, string(html))
if err != nil {
return err
}