~adnano/kiln-discuss

1

[Feature Request] Would you consider allowing nested parameters in Site config?

Details
Message ID
<CAMhzVamfHjU-v8eBL9unt38S5A+-Kxw3Cm3bMwjC2qbzbd8E3g@mail.gmail.com>
DKIM signature
pass
Download raw message
Patch: +1 -1
Hi,

Thanks for such a simple & minimal Static Site Generator!

I was going through the docs and source when trying out Kiln. I
noticed that the Params in site config (site.go#L18) is a flat list,
whereas the frontmatter Params (page.go#L25) allows an arbitrary
nested map. I tried doing a basic grep on the source tree and saw that
the codebase doesn't make any assumptions about how it should be.

Would you be willing to consider changing it to a nested map? Are
there any disadvantages you foresee?

(Changes made)

diff --git a/site.go b/site.go
index c5d5d1d..e219632 100644
--- a/site.go
+++ b/site.go
@@ -15,7 +15,7 @@ import (
type Site struct {
       Title      string            `toml:"title"`
       Tasks      []*Task           `toml:"tasks"`
       Params     map[string]string `toml:"params"`
       Params     map[string]interface{} `toml:"params"`
       Permalinks map[string]string `toml:"permalinks"`
       Generated  time.Time         `toml:"-"`
       Root       *Page             `toml:"-"`


Cheers!
Details
Message ID
<CIB43K4KARSP.39SUPMQYUPLM3@framework>
In-Reply-To
<CAMhzVamfHjU-v8eBL9unt38S5A+-Kxw3Cm3bMwjC2qbzbd8E3g@mail.gmail.com> (view parent)
DKIM signature
pass
Download raw message
On Thu Mar 3, 2022 at 1:15 PM EST, Prasanna S wrote:
> Hi,
>
> Thanks for such a simple & minimal Static Site Generator!

Glad you like it!

> I was going through the docs and source when trying out Kiln. I
> noticed that the Params in site config (site.go#L18) is a flat list,
> whereas the frontmatter Params (page.go#L25) allows an arbitrary
> nested map. I tried doing a basic grep on the source tree and saw that
> the codebase doesn't make any assumptions about how it should be.
>
> Would you be willing to consider changing it to a nested map? Are
> there any disadvantages you foresee?

I don't think there was any reason for this. I would be willing to
change it. Can you send a patch to change it?
Reply to thread Export thread (mbox)