Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(metagen): allow falling back to the default template functions #1079

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

mattpolzin
Copy link
Contributor

@mattpolzin mattpolzin commented Sep 12, 2023

First time really trying to do anything proper in Lua so no hard feelings if you've got style critiques or I've done something obviously silly!

I was overriding the template for metagen earlier today and thought it would be really nice if I could specify that I wanted to override some metadata keys & functions but in other cases I wanted to include a key and fallback to the default builtin function.

For example, the following configuration for the template would include all the default keys but only override the values for the authors and categories entries:

template = {
  { "title" },
  { "description" },
  { "authors", "Steve M. & Martin S." },
  { "categories", "[ Misc ]" },
  { "created" },
  { "updated" },
  { "version" }
}

@vhyrro
Copy link
Member

vhyrro commented Sep 15, 2023

The code is very clean for a first contribution! Thanks a lot :D

@vhyrro vhyrro changed the title feat: allow falling back to the default metagen template functions feat(metagen): allow falling back to the default template functions Sep 15, 2023
@vhyrro vhyrro merged commit 8200ebc into nvim-neorg:main Sep 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants