diff --git a/lib/web/docusaurus/dsite_generate_docs.v b/lib/web/docusaurus/dsite_generate_docs.v index f656b655..a5e2ac67 100644 --- a/lib/web/docusaurus/dsite_generate_docs.v +++ b/lib/web/docusaurus/dsite_generate_docs.v @@ -145,13 +145,25 @@ fn (mut generator SiteGenerator) page_generate(args_ Page) ! { fn (mut generator SiteGenerator) section_generate(args_ Section) ! { mut args := args_ - mut c := '{ + mut c := '' + if args.description.len > 0 { + c = '{ + "label": "${args.label}", + "position": ${args.position}, + "link": { + "type": "generated-index", + "description": "${args.description}" + } + }' + } else { + c = '{ "label": "${args.label}", "position": ${args.position}, "link": { "type": "generated-index" } }' + } mut category_path := '${generator.path.path}/${args.path}/_category_.json' mut catfile := pathlib.get_file(path: category_path, create: true)! diff --git a/lib/web/site/model_site_section.v b/lib/web/site/model_site_section.v index 065e5d0a..df491fa0 100644 --- a/lib/web/site/model_site_section.v +++ b/lib/web/site/model_site_section.v @@ -10,8 +10,9 @@ pub mut: pub struct Section { pub mut: - name string - position int - path string - label string + name string + position int + path string + label string + description string } diff --git a/lib/web/site/play_page.v b/lib/web/site/play_page.v index 535ea5b2..333293df 100644 --- a/lib/web/site/play_page.v +++ b/lib/web/site/play_page.v @@ -45,6 +45,7 @@ fn play_pages(mut plbook PlayBook, mut site Site) ! { } section.label = p.get_default('label', texttools.name_fix_snake_to_pascal(section.name))! section.path = p.get_default('path', texttools.name_fix(section.label))! + section.description = p.get_default('description', '')! site.sections << section action.done = true // Mark the action as done