mirror of
https://github.com/sbrow/thor.git
synced 2026-08-26 11:23:32 -04:00
feat: Added 'Table of Contents' markdown extension.
This commit is contained in:
@@ -28,6 +28,7 @@ Page :: struct {
|
||||
content: string,
|
||||
og: Open_Graph,
|
||||
draft: bool,
|
||||
toc: string,
|
||||
_is_index: bool `private`,
|
||||
}
|
||||
|
||||
@@ -280,6 +281,10 @@ load_page :: proc(
|
||||
page.content = md.process(body, ext, file_path, context.allocator)
|
||||
}
|
||||
|
||||
if fm.toc {
|
||||
page.toc = md.generate_toc(page.content, context.allocator)
|
||||
}
|
||||
|
||||
ok = true
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user