From 85f15f033d8c56366ac1e6ae93c940db8ad067ca Mon Sep 17 00:00:00 2001 From: Drake Bott Date: Sat, 17 Aug 2024 19:00:27 -0500 Subject: [PATCH] docs: Add template example to metagen docs (#1559) --- .../modules/core/esupports/metagen/module.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/neorg/modules/core/esupports/metagen/module.lua b/lua/neorg/modules/core/esupports/metagen/module.lua index 5466a78a1..4f1c933af 100644 --- a/lua/neorg/modules/core/esupports/metagen/module.lua +++ b/lua/neorg/modules/core/esupports/metagen/module.lua @@ -145,6 +145,24 @@ module.config.public = { delimiter = ": ", -- Custom template to use for generating content inside `@document.meta` tag + -- The template is a list of lists, each defining a key-value pair of metadata + -- + -- Example: + -- ``` + -- template = { + -- -- Default field name without a value will fall back to the default behavior + -- { "title" }, + -- -- Set a custom value for "authors" field + -- { "authors", "Vhyrro" }, + -- -- Fields can be set by lua functions + -- { + -- "categories", + -- function() + -- return {"Category-1", "Category-2"} + -- end + -- } + -- } + -- ``` template = default_template, -- Custom author name that overrides default value if not nil or empty