-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
[Improvement] (merge function) Multiple merging dict #7595
Comments
Right now, I'm trying to get around with
But for more complex json, |
I haven't read this is in detail, but wouldn't this be somehow the same: {{ $m = $m | merge $m2 | merge $m3 }} ....? |
Is it even possible to make a chain for Update: |
And potentially more effective, I agree. |
I've submitted a PR for consideration. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
My current hugo version:
v0.74.3-DA0437B4 linux/arm
2020-07-23T16:22:34Z
The current
merge
function only allow merge a pair ofdict
. However, in a certain case, more than two dicts could be merged. For example, if you want to make JSON template,dict
is the best option for clean code. But if an object with too many properties could lead to a huge trouble.Instead of that,
merge
is recommend to break down an infinitive long line for the sake of clean code.But with the merge limited, the above code is impossible to achieve.
I think it would be nice if we could have this improvement for the next update.
The text was updated successfully, but these errors were encountered: