Closed moonstar-x closed 1 month ago
Thanks for the kind words!
You can already do this using YAML anchors, which you can read more about here and here.
Here's a slightly modified version of the example you provided that uses them:
widgets:
- &reusable-clock
type: clock
timezones:
- timezone: America/Los_Angeles
label: Los Angeles
- timezone: America/New_York
label: New York
pages:
- name: Page 1
columns:
- size: full
widgets:
- <<: *reusable-clock
- name: Page 2
columns:
- size: full
widgets:
- <<: *reusable-clock
Oh wow thank you. I remember seeing something about that in your documentation but I didn't think it could be used like that.
Thanks for your help!
Hi, thanks for this brilliant project, I love it!
In my own instance I'm looking to have multiple pages, and some of them share the same widgets across multiple pages.
Currently I would have to copy-paste the widgets in each page's definition but it can be a bit difficult to update them in the future since I would have to make changes everywhere I use them.
It'd be cool if I could define widgets outside the
pages
definition so that I could reference them instead. An example of what a configuration file would look like:Thanks, let me know what you think, if I have some free time off work I could probably cook up a PR but my Go skills are a bit rusty. 😄